Program 1: Before running the below code, a file file. It is very easy to writer data into a text file using StreamWriter Class and most of the beginners prefer to use this class in writing file. Return Value: Returns a stream writer that appends specified UTF-8 encoded texts to the specified file or to a new file.īelow are the programs to illustrate the File.AppendText() method.
#WRITE TO TEXT FILE USING STREAMWRITER C HOW TO#
![write to text file using streamwriter c write to text file using streamwriter c](https://csharpcorner-mindcrackerinc.netdna-ssl.com/article/save-text-file-c-sharp-example/Images/console.png)
![write to text file using streamwriter c write to text file using streamwriter c](https://i.ytimg.com/vi/wIM_ErlfPL4/maxresdefault.jpg)
![write to text file using streamwriter c write to text file using streamwriter c](https://www.codeproject.com/KB/aspnet/ExportingData/Image2_small.jpg)