By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,569 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,569 IT Pros & Developers. It's quick & easy.

listbox help

P: n/a
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...
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Dim sw as streamwriter = new streamwriter("myfile.txt", true) '2nd option
sets append property to true
sw.writeline "Hi"
sw.close
"Thunderinme" <sy****@absamail.co.za> wrote in message
news:yI********************@is.co.za...
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...

Nov 20 '05 #2

P: n/a
* "Thunderinme" <sy****@absamail.co.za> scripsit:
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
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.