FileStream vs/differences StreamWriter? http://stackoverflow.com/questions/4963667/filestream-vs-differences-streamwriter What is different between FileStream and StreamWriter in dotnet? A FileStream is a Stream. Like all Streams it only deals with b…
1.为什么要使用StreamReader或者StreamWriter 如果对文本文件需要读取一部分显示一部分则使用FileStream会有问题,因为可能FileStream会在读取的时候把一个汉字的字节数给分开.所以造成显示的时候无法正确显示字符串.所以对于读取大文本文件一般使用StreamReader类.对于大文本文件写入一般用StreamWriter类. 2.StreamWriter //1.创建一个StreamWriter using (StreamWriter sw = new Stre…