FileStream vs/differences StreamWriter?

前端 未结 6 790
清酒与你
清酒与你 2020-12-22 18:31

Question:

What is different between FileStream and StreamWriter in .Net?

What context are you supposed to use it?

6条回答
  •  情书的邮戳
    2020-12-22 19:00

    A FileStream is explicitly intended for working files.

    A StreamWriter can be used to stream to any type of Stream - network sockets, files, etc.

    ScottGu explains the different Stream objects quite nicely here: http://www.codeguru.com/Csharp/Csharp/cs_data/streaming/article.php/c4223

提交回复
热议问题