Need help saving from combo box / text box to file.

Wynds

New member
Joined
Feb 25, 2008
Messages
1
Programming Experience
Beginner
Can't figure out to save from a textbox or a combo box to a file and the below code is giving me errors, any help appreciated thanks.




Dim name As String
name = txtboxName.Text
IO.File.ReadAllLines("savedInformation.txt", name)
IO.File.ReadAllText("Listbox.txt", name)
 
Try:

Dim w As New IO.StreamWriter("C:\test.txt")

w.WriteLine(txtTest.text)

w.Close()

And to read from file:

Dim r As IO.StreamReader
r = New IO.StreamReader("C:\test.txt")

Obviously change directories to your .txt files.

And use r.readline to get information from file.
 
Back
Top