Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C# (http://www.programmingforums.org/forum16.html)
-   -   Adding more info to a text file without erasing (http://www.programmingforums.org/showthread.php?t=12974)

crawforddavid2006 Apr 11th, 2007 2:06 AM

Adding more info to a text file without erasing
 
Ok I would like to add more info to a text file without erasing what is already written to that file.

What i mean is i have a program that reads the text from a text box and saves it to the txt file. I would like that same program to add a new line of text to that txt file without erasing the original text. I hope that makes sense, and yes i do know how to use a stream writer and reader.

Infinite Recursion Apr 11th, 2007 9:14 AM

Open the file in Append Mode.

Booooze Apr 11th, 2007 2:10 PM

Also, if your really messing with the file, it's sometimes easier to read all of the data, and then write it all in again. Just depends on what your task is, and how efficient you can make it.


All times are GMT -5. The time now is 3:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC