Save data into a.txt file

PANOSP
09-27-2004, 08:55 AM
Does anyone know how to make an application which saves he data of 5 textboxs and richtextoxs into a .txt file by clicking a buton????? :confused:

Iceplug
09-27-2004, 09:02 AM
Yes. And you can do it too.

Just check out the StreamWriter.

To set up the StreamWriter, you have to create a new instance (and this is where you give it the filename)
Dim SW As IO.StreamWriter = New IO.StreamWriter(filename)

To save 1 textbox's text to the file.
SW.WriteLine(TxBox.Text) 'TxBox is the name of your textbox.

To save 1 richtextbox's text to the file.
SW.WriteLine(RTB.Text) 'RTB is the name of your richtextbox.

When you are done, don't forget to close the StreamWriter.
SW.Close()

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum