StreamReader sr;
string fc;
sr = File.OpenText(@"E:\银狐\朋友.txt");
while(sr.Peek ()!=-1)
{
fc=sr.ReadLine ();
fc = fc.ToString();
this.Label2.Text+= fc+"<br>";
}
sr.Close(); 为什么在Label控件里汉字显示乱码而英文字母显示正常?在线等!!不胜感激!!
string fc;
sr = File.OpenText(@"E:\银狐\朋友.txt");
while(sr.Peek ()!=-1)
{
fc=sr.ReadLine ();
fc = fc.ToString();
this.Label2.Text+= fc+"<br>";
}
sr.Close(); 为什么在Label控件里汉字显示乱码而英文字母显示正常?在线等!!不胜感激!!
string FileName = @"E:\银狐\朋友.txt";
if (File.Exists(FileName))
{
//读取指定的文本文件,并支持中文编码字符
StreamReader objReader =
new StreamReader(FileName, System.Text.Encoding.GetEncoding("gb2312"));
string aa = objReader.ReadToEnd();
objReader.Close();//关闭流
}