Writing text files in C#

My quick-start file writing example for those who go months between needing to write a file.

StreamWriter writer = new StreamWriter(filename, false);
writer.Write("some text");
writer.Close();

I remember it being harder than this..

Reference:
Streamwriter documentation

Posted on 05 Nov 04 by Helen Emerson (last updated on 05 Nov 04).
Filed under .NET