Cracken
Member
Hi
I am building a string from a combo box but I cant get it to save to a text file.
Could anyone advise me on a simple way to write a string to this file and add to it ?
Here's my code I tried so far:
Thanks in advance.
Mark
I am building a string from a combo box but I cant get it to save to a text file.
Could anyone advise me on a simple way to write a string to this file and add to it ?
Here's my code I tried so far:
VB.NET:
Private Sub cbZones_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbZones.SelectedIndexChanged
txtString.Text += cbZones.Text + "/"
End Sub
Private Sub btnWrite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWrite.Click
Dim fs As FileStream
File.Create("C:\zoning.txt")
Dim sw As StreamWriter = New StreamWriter(fs)
sw.Write(txtString.Text)
sw.Flush()
sw.Close()
End Sub
Thanks in advance.
Mark
Last edited by a moderator: