- Joined
- Nov 20, 2004
- Messages
- 1,414
- Reaction score
- 27
I've been wondering why this isn't working. I'm trying to get this to load a file, but it doesn't seem to be working. Any ideas?
Edit - Nevermind, I think that its working..
I think the problem is parsing the integer from the string possibly? Could anyone tell me?
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace BranchesV3
{
public class uservars
{
public int level;
public void load(string name)
{
Stream stream = new FileStream(name + ".sfm", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
StreamReader reader = new StreamReader(stream);
string input = "";
while ((input = reader.ReadLine()) != null)
{
level = int.Parse(input);
}
}
}
}
Edit - Nevermind, I think that its working..
I think the problem is parsing the integer from the string possibly? Could anyone tell me?