By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,420 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,420 IT Pros & Developers. It's quick & easy.

appending text to a file

P: n/a
Does anybody have a simple example of appending text to a text file?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
using System.IO;

StreamWriter sw = new StreamWriter("C:\\MyFile.txt", true);

sw.Write("Hej.");

sw.Close();
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Does anybody have a simple example of appending text to a text file?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

P: n/a
Thanks Dennis. I found a good example of writing and appending here
which is very similar to your example :

http://www.csharpfriends.com/Article...px?articleID=5
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

P: n/a
MSDN sample @
http://msdn.microsoft.com/library/de...gtologfile.asp

"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Does anybody have a simple example of appending text to a text file?
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.