摘要:
ANSI文本格式读写
StreamReader sr = new StreamReader("yourFilePath", Encoding.Default);
string strBody = sr.ReadToEnd();
sr.Close();
写文件
StreamWriter sw = new StreamWriter("yourFilePath", false, Encoding.Default);
sw.Write("中文ABC");
sw.Close();
//字符Unicode
string s = "abCDlks";
//字符转Default(//8位无编码整数)
byte[] buffer = Encoding.Default.GetBytes(s);
//Default转Utf-8
string sU8 = Encoding.UTF8.GetString(buffer);
C# 字符转ASCII码,ASCII码转字符
........................... 阅读全文