strPath = strPath + DateTime.Today.ToShortDateString() + ".txt";
sw = new StreamWriter(strPath,true,System.Text.Encoding.GetEncoding("BIG5"));这样读取可以采用不同的字符编码
sw = new StreamWriter(strPath,true,System.Text.Encoding.GetEncoding("BIG5"));这样读取可以采用不同的字符编码
可能我沒說明白,我的問題1就是,好比讀了a.txt,你會返回個"Big5",讀了b.txt,你會返回個"UTF8",讓我知道哪個文本文檔是什麼編碼方式的,要不用肉眼看不出來啊
this.Text=sr.CurrentEncoding.EncodingName; //返回当前文件编码方式
sr.Close();
sw.Write("123中文abc");
sw.Close();采用指定编码创建文本