READ A TEXT FILE
Hi, I'm currently making a game in Windows Mobile 6 SDK (C#), and I want
to save top 3 high scores in text file. I have a text file and I want
to read the file and display it in a textbox. So far, this is what I've
done but when I tried to run it, nothing happens in the textbox.
FileStream st1 = new FileStream(@"E:\ScoreTop1.txt", FileMode.Open, FileAccess.Read);
FileStream st2 = new FileStream(@"E:\ScoreTop2.txt", FileMode.Open, FileAccess.Read);
FileStream st3 = new FileStream(@"E:\ScoreTop3.txt", FileMode.Open, FileAccess.Read);
StreamReader SR1 = new StreamReader(st1);
StreamReader SR2 = new StreamReader(st2);
StreamReader SR3 = new StreamReader(st3);
txtTop1.Text = SR1.ReadLine();
txtTop2.Text = SR2.ReadLine();
txttop3.Text = SR3.ReadLine();
FileStream st1 = new FileStream(@"E:\ScoreTop1.txt", FileMode.Open, FileAccess.Read);
FileStream st2 = new FileStream(@"E:\ScoreTop2.txt", FileMode.Open, FileAccess.Read);
FileStream st3 = new FileStream(@"E:\ScoreTop3.txt", FileMode.Open, FileAccess.Read);
StreamReader SR1 = new StreamReader(st1);
StreamReader SR2 = new StreamReader(st2);
StreamReader SR3 = new StreamReader(st3);
txtTop1.Text = SR1.ReadLine();
txtTop2.Text = SR2.ReadLine();
txttop3.Text = SR3.ReadLine();
Comments
Post a Comment