
November 14th, 2011, 11:00 AM
|
|
Registered User
|
|
Join Date: Nov 2011
Posts: 9
Time spent in forums: 1 h 48 m 10 sec
Reputation Power: 0
|
|
|
How do I read a text file into an array?
I would like to read in a text file which contains a number of integers (one per line) and place these into an array. So far I have only been able to read them into a textbox like so:
Code:
Dim path As String = "C:\example.txt"
Dim sReader As New System.IO.StreamReader(path)
Dim textline As String
Do While sReader.Peek() <> -1
textline = textline & sReader.ReadLine() & vbNewLine
Loop
TextBox1.Text = textline
Instead of spitting the values into a textbox I want them stored in an array. How would I do this?
Thanks!
|