C# Client/Server: using Streamreader/writer

前端 未结 4 1091
野性不改
野性不改 2020-12-10 21:43

I\'m relatively new to C# but here goes:

I am developing a remote file service client/server console application in C# which is supposed to exchange messages using

4条回答
  •  臣服心动
    2020-12-10 22:10

    Whenever you use StreamWriter you need to Flush() the contents of the stream. I'll quote MSDN as the reason becomes quite clear:

    Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream.

    You can call it quite simply like:

    wr.flush();
    

提交回复
热议问题