StreamReader/ StreamWriter

aman_VB

Member
Joined
Apr 27, 2010
Messages
23
Programming Experience
1-3
I have a Form with 4 Textboxes. The Textboxes are multiline. To write the contents of the 4 textboxes, I did the following.

'partial code
Using sw As StreamWriter = New StreamWriter(myStream)
sw.WriteLine(TextBox1.Text)
sw.WriteLine(TextBox2.Text)
sw.WriteLine(TextBox3.Text)
sw.WriteLine(TextBox4.Text)
sw.Close()
End Using
myStream.Close()

How do I read to or populate the Textboxes using StreamReader or StringReader or other means?
 
You're going to have to do more than that when you write the data. As it stands, there's no way to distinguish between line breaks that were within the text of a TextBox and the line breaks that you added between them. You're going to need to include some sort of delimiting text between each block so that you can identify what's what.
 
Back
Top