日期:2014-05-20  浏览次数:21046 次

C#FileStream异步读取问题
用FileStream.BeginRead异步读取文件。
比如一个文本文件的一部分   “if   exists”
为什么读出的结果会是“i□f□   □e□x□i□s□t□s□”
□=\0

------解决方案--------------------
帮顶,懂
------解决方案--------------------
你可以使用StreamReader来指定要以何种编码读取
比如

StreamReader( "c:\\abc.txt ", Encoding.UTF8);

或者

StreamReader( "c:\\abc.txt ", Encoding.ASCII);