Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import text data to a specific textbox

Status
Not open for further replies.

at51178

Technical User
Mar 25, 2002
587
US
Hi,

I created a form that exports my textbox values to a text file now I am looking to import the information back from the text file to the textbox on my form is there a way to do this.
Below you will find the code I used to export the data

Any help would be appreciated
Thank You

-- Code --


Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText("C:\sample.txt")
oWrite.WriteLine("{0,10}{1,10}{2,25}", "Last Name", "First Name", "Age")
oWrite.WriteLine("{0,10}{1,10}{2,25}", Me.txtLastName.Text, Me.txtFirstName.Text, Me.txtAge.Text)
oWrite.Close()
 
Try using the System.IO.StreamReader object to open the file. then use one of the methods (readline, readtoend) to get the data and plug into your textbox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top