代码如下:
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string file_path = Application.StartupPath + "\类型.txt";
string content;
using (FileStream stream = File.OpenRead(file_path))
{
using (StreamReader reader = new StreamReader(stream))
{
content = reader.ReadToEnd();
}
}
MessageBox.Show(content);
}
为什么用这种方法打开txt文件后,中文全部显示乱码?