Karl.Green
New member
- Joined
- Nov 28, 2011
- Messages
- 2
- Programming Experience
- Beginner
I have been learning VB for about 3 months now at college and decided to enhance my skills by making my own project at home. My project is basically a game where you have to guess if the next number will be higher or lower than the previous version and you can place bets on it. I have done all of this ok but I wanted to create a high score system so that you could save your score.
I can manage to write out to a text file ok so that it looks like this
Highscores
Name
Score
Name
Score
Name
Score
etc. But I am not sure on how to read in a specific line. So for example I want lblHighscore1.text to equal line 3 of the text document (as vb counts the first line as 0)
So far all I have is this;
Dim objReader As IO.StreamReader = New IO.StreamReader("C:\Users\Karl\Desktop\HighScore.txt")
lblHighscore1.Text = (objReader.ReadLine)
I know it does not look like I have got very far but being new I do not know how to procede!
Any help would be greatly appreciated, thanks!
I can manage to write out to a text file ok so that it looks like this
Highscores
Name
Score
Name
Score
Name
Score
etc. But I am not sure on how to read in a specific line. So for example I want lblHighscore1.text to equal line 3 of the text document (as vb counts the first line as 0)
So far all I have is this;
Dim objReader As IO.StreamReader = New IO.StreamReader("C:\Users\Karl\Desktop\HighScore.txt")
lblHighscore1.Text = (objReader.ReadLine)
I know it does not look like I have got very far but being new I do not know how to procede!
Any help would be greatly appreciated, thanks!