Extracting from a Textfile

Decklan

Member
Joined
Feb 3, 2006
Messages
13
Programming Experience
Beginner
Hi guys
Im just starting out in VB.Net and my first program is to store customer info in a textfile, I have managed to write the code to save the file, the file contains all the info on 1 customer, each bit of info is on a separate line in the textfile.

My problem is this how do I extract each line and put them in to textboxes?

Thanks

Nick :)
 
yes, and the easiest way is to save your data is seperated by commas (or other symbol) so you can use a split when you read each line

eg:
Dim LineData() As String = ALine.Split(","c)

populates an array (LineData) with the values between each comma
 
Phill64 said:
yes, and the easiest way is to save your data is seperated by commas (or other symbol) so you can use a split when you read each line

eg:
Dim LineData() As String = ALine.Split(","c)

populates an array (LineData) with the values between each comma
the StreamWriter and StreamReader classes do have WriteLine and ReadLine methods so splitting the data wouldnt have to be done (easier to read things in one giant loop this way)
 
Back
Top