Writing to Files in C#
Writing to Files in C#: Writing a File: StreamWriter's Defaults, Appending to a File.
Updated
- Writing a File: StreamWriter's Defaults (Journeyman): A StreamWriter writes text to a file the way Console writes to the screen. By default it creates the file, or replaces one that's already there. Close it with using, so everything written reaches the disk.
- Appending to a File (Journeyman): To add to the end of a file instead of replacing it, open a StreamWriter with append set to true, or use File.AppendAllText. Either creates the file if it isn't there yet.