An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
For performance reason, the content may not be immediately written to your disk when you are writing to a file.
You txt content is in the buffers, if you invoke the Flush(), the buffers write to disk.
The StreamWriter has a AutoFlush property, please refer for more :
If right, please Accept.
Enjoy programming!!!