Results 1 to 2 of 2

Thread: StreamWriter question [Resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    127

    StreamWriter question [Resolved]

    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 box 6


    Any help with the proper code for both reading and writing like this is greatly appreciated by a newbie vb.net person.
    Last edited by teamdad; Jun 13th, 2004 at 08:14 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width