listbox help

  • Thread starter Thread starter Thunderinme
  • Start date Start date
T

Thunderinme

Greetings everyone

I am trying to get the EOF function to work in vb.net.
All I want to do is write a name in a textbox click the 'save' button and
the name must be written in a .txt file. That part is simple enough, but
when entering the next name I am unable to get it underneath the previous
entry in the .txt file. Could someone please give me the correct EOF code
for writing a textbox entry to a .txt file in consecutive lines.

thanks very much...
 
* "Thunderinme said:
I am trying to get the EOF function to work in vb.net.
All I want to do is write a name in a textbox click the 'save' button and
the name must be written in a .txt file. That part is simple enough, but
when entering the next name I am unable to get it underneath the previous
entry in the .txt file. Could someone please give me the correct EOF code
for writing a textbox entry to a .txt file in consecutive lines.

\\\
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrintLine(1, Me.TextBox1.Text)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FileOpen(1, "C:\foo.txt", OpenMode.Append)
End Sub

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
FileClose(1)
End Sub
///
 
Hi,

Dim sw as streamwriter = new streamwriter("myfile.txt", true) '2nd option
sets append property to true
sw.writeline "Hi"
sw.close
 
Back
Top