|
-
December 4th, 2004, 03:43 PM
#1
Adding information to a text file
I want to add information from different txtboxes into my file that i've created, so later I can view the updated information in my listbox.
I've tried just using lstrecords.items.add(txtfirstname.text)
lstrecords.items.add(txtlastname.text)
lstrecords.items.add(txtmajor.text)
and so forth, but it only adds to the listbox i've created
I want it to add to the text file, and not have it display back as
Tom
Bernard
T122
7.0
I want it to display back in the text file as one line
Tom Bernard T122 7.0
Can someone help me with doing this??
-
December 4th, 2004, 10:59 PM
#2
Re: Adding information to a text file
First make a single string variable which should hold the entire string:
"Tom Bernard T122 7.0"
After that write this string into a text file. For this you have to use "StreamWriter" class from .Net.
For reading back from the text file, you can use the "StreamReader" class.
These are all part of System.IO namespace.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|