求救!读取文件中的汉字为什么会出现这种情况
在一个winform工程中读取文件内容,汉字可正常显示
System.IO.StreamReader sr = new StreamReader(@".\a.ini", System.Text.UnicodeEncoding.Default);
this.button1.Text = sr.ReadLine();
this.button2.Text = sr.ReadLine();
this.button3.Text = sr.ReadLine();
this.label1.Text = sr.ReadLine();
sr.Close();
在一个类库中读取文件内容,汉字为什么会显示为乱码
sr1 = new StreamReader(@".\DataBase.ini", System.Text.UnicodeEncoding.Default);
strPath = sr1.ReadLine();
strPath += System.DateTime.Now.ToShortDateString().ToString() + ".txt";
sr1.Close();