hi guys i`v got a solution for English OP ,VS 2008 :(与#12楼类似的解决但不太一样) control panael => regional and language opions => Advanced then choose chinese(PRC) . and then press ok, finally restart your PC . it works with me after all thank to all of you !!!!!!!!!
先把文件保存成utf-8吧...
我的os,vs也都是英文环境。 读文本文件中的汉字出错主要是由于编码出的问题。您可以在初始化streamreader对象的时候指定它的编码,您可以参考以下如下的代码:
StreamReader fSrd= new StreamReader ("e:\\temp\\csdn.txt",Encoding.Default );
关于streamreader构造函数详细的说明,请参看:
.NET Framework Class Library StreamReader Constructor (Stream, Encoding)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiostreamreaderclassctortopic4.asp
control panael => regional and language opions => Advanced then choose chinese(PRC) . and then press ok, finally restart your PC . it works with me
after all thank to all of you !!!!!!!!!