FileStream fs = new FileStream(url, FileMode.Open);
StreamReader sr = new StreamReader(fs);
string strGeci = sr.ReadLine();
sr.Close();
fs.Close();
大家看看,这段代码读取的结果,为什么一到汉字就是乱码?
FileStream fs = new FileStream(url, FileMode.Open);
StreamReader sr = new StreamReader(fs);
string strGeci = sr.ReadLine();
sr.Close();
fs.Close();
大家看看,这段代码读取的结果,为什么一到汉字就是乱码?
设置字符集
string strGeci = sr.ReadLine();应该改成 sr.ReadToEnd();