Tuesday, January 2, 2018

Write to a file in CSharp

Quick and dirty way to write to a file in C#.

StreamWriter log = new StreamWriter(@c:\log.txt);
log.WriteLine(ErrorMessage);
log.WriteLine();
log.Close();

No comments:

Post a Comment

Thank you for your comment.