Hi
I am learning vb.net and am trying to write information to a text file or to
append to that file if it already exists.
I am using the following code to write to the file, however the text is
always being replaced. Please let me know if there is a better way of doing
this.
Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim file As New System.IO.StreamWriter("c:\test.txt")
Dim name As String = TextBox1.Text
Dim value As String = TextBox2.Text
file.Write("Hello " & name & " You entered the value of " & value)
file.Close()
End Sub
Thanks
Doug