04-05-2012, 12:04 PM
All that really has to be looked at are these segments of code:
So what you are doing is writing two things into a text file, separated by an equals sign. Then you are reading that text file, and splitting up the elements by the equals sign. So you are splitting them up as
So with that in mind, you then try to get splitread(3).ToString. This throws an error because in the list, as we just saw, there are only items with an index of 0 and 1, and an item with the index of 3 does not exist.
Code:
writer.Write(data(3).ToString + "=" + data(0).ToString)
Code:
Dim splitread() As String = reader.ReadToEnd.Split("=")
Code:
lbl_rank1.Text = "Rank: " + splitread(3).ToString
So what you are doing is writing two things into a text file, separated by an equals sign. Then you are reading that text file, and splitting up the elements by the equals sign. So you are splitting them up as
- data(3).ToString
data(0).ToString
So with that in mind, you then try to get splitread(3).ToString. This throws an error because in the list, as we just saw, there are only items with an index of 0 and 1, and an item with the index of 3 does not exist.