C# – First steps with C# and .NET – part 043.

In this tutorial, I will show you a C # source code that he uses FileStream and StreamWriter to write to the file.
A Stream for a file, supporting both synchronous and asynchronous read and write operations.
A TextWriter is used for writing characters to a stream in a particular encoding.
The result is a text file with the contents: This is a line of text.
The following lines will be displayed in the program console:

If you want to use encoding then you will have to add and modify with this source code in C#.

Let’s see the source code:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.