Before anyone heckles or tells me to read documentation... I have. I have read the MSDN page on how to read from a file. I have consulted my books on many occasions but somethnig is still escaping me. This is what I have as far as code goes:
Let me clear some of this up for you.Code:Dim W As IO.StreamReader = System.IO.File.OpenText("NumberSet.txt") While Not W.EndOfStream Dim i As String ListBox1.Items.Add(i) End While Dim count As Integer = 0 For count = 0 to W.Peek - 1 Dim X As String X = CStr(ListBox1.Items.IndexOf(count)) NumbersArray(x) Next
I have a txt file with 100 numbers in it. I want to write code that reads the NumberSet file line by line and adds each value into the corresponding index of NumbersArray(). VB keeps throwing me "Expression is not a method" when I attempt to populate my array, as shown by the highlighted line in my code...
Its been two days hard charging at this and it is totally escpaing me.
Any help would be GREATLY appreciated.





Reply With Quote