I know I can use this code to write to a file with specific formats:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim writer As New IO.StreamWriter("C:\test.ini")
writer.Write(TextBox1.Text & " = " & TextBox2.Text)
writer.Flush()
writer.Close()
End Sub
But, how can I read the text from the file back into the orignal text boxes seperately like they were typed into in the first place by using a second button click?
P.S. I would like to have 2 coloms of text boxes ligned up one beside the other and 3 text boxes in each stack for a total of 6 text boxes. To make things more complicated; I would need the file when saved to have each line separate. The file should look like this when saved.
Text from box 1 = Text from box 2
Text from box 3 = Text from box 4
Text from box 5 = Text from box6
Any help with the proper code for both reading and writing like this is greatly appreciated by a newbie vb.net person.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim writer As New IO.StreamWriter("C:\test.ini")
writer.Write(TextBox1.Text & " = " & TextBox2.Text)
writer.Flush()
writer.Close()
End Sub
But, how can I read the text from the file back into the orignal text boxes seperately like they were typed into in the first place by using a second button click?
P.S. I would like to have 2 coloms of text boxes ligned up one beside the other and 3 text boxes in each stack for a total of 6 text boxes. To make things more complicated; I would need the file when saved to have each line separate. The file should look like this when saved.
Text from box 1 = Text from box 2
Text from box 3 = Text from box 4
Text from box 5 = Text from box6
Any help with the proper code for both reading and writing like this is greatly appreciated by a newbie vb.net person.