TwoWing
Well-known member
Hello Friends,
I bet the answer to this is easy - but I don't know it!
Can someone please help with this? With the following Code I can get all the towns listed in the file with the MessageBox. But only one at a time. Can someone please give me the Code to get the whole lot in a TextBox (Multiline set to True), line after line.
I have earnestly tried different ways.
Also, I want to go a lot deeper into this topic, so if there are any pointers please can you indicate me in the right direction.
Sincerely, TwoWing
I bet the answer to this is easy - but I don't know it!
Can someone please help with this? With the following Code I can get all the towns listed in the file with the MessageBox. But only one at a time. Can someone please give me the Code to get the whole lot in a TextBox (Multiline set to True), line after line.
VB.NET:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim sReader As IO.StreamReader
sReader = IO.File.OpenText("C:\Towns.txt")
Dim data As String
data = sReader.ReadLine()
Do While data <> ""
MessageBox.Show(data)
data = sReader.ReadLine()
Loop
sReader.Close()
End Sub
Also, I want to go a lot deeper into this topic, so if there are any pointers please can you indicate me in the right direction.
Sincerely, TwoWing