public void Read()
{
if (FormMain.FileName != string.Empty)
{
textBox1.Text = string.Empty;
StreamReader sr = new StreamReader(FormMain.FileName, System.Text.Encoding.Default);//加System.Text.Encoding.Default后能正常显示
//或者StreamReader reader = new StreamReader( "temp.txt ", System.Text.Encoding.GetEncoding( "GB2312 "));
textBox1.Text = sr.ReadToEnd();
sr.Close();
}
}
{
if (FormMain.FileName != string.Empty)
{
textBox1.Text = string.Empty;
StreamReader sr = new StreamReader(FormMain.FileName, System.Text.Encoding.Default);//加System.Text.Encoding.Default后能正常显示
//或者StreamReader reader = new StreamReader( "temp.txt ", System.Text.Encoding.GetEncoding( "GB2312 "));
textBox1.Text = sr.ReadToEnd();
sr.Close();
}
}