标签:VID The 中文 程序包 defining null coding 实现 pre
static void Main(string[] args) { string path = "F:\\1.txt"; StreamReader sr = new StreamReader(path, Encoding.Default); String line; while ((line = sr.ReadLine()) != null) { Console.WriteLine(line.ToString()); } sr.Close(); Console.ReadLine(); }
static void Main(string[] args) { string path = "F:\\1.txt"; StreamReader sr = new StreamReader(path, Encoding.GetEncoding("GB2312")); String line; while ((line = sr.ReadLine()) != null) { Console.WriteLine(line.ToString()); } sr.Close(); Console.ReadLine(); }
static void Main(string[] args) { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); string path = "F:\\1.txt"; StreamReader sr = new StreamReader(path, Encoding.GetEncoding("GB2312")); String line; while ((line = sr.ReadLine()) != null) { Console.WriteLine(line.ToString()); } sr.Close(); Console.ReadLine(); }
标签:VID The 中文 程序包 defining null coding 实现 pre
原文地址:https://www.cnblogs.com/liuxinghen/p/10185207.html