//c#文件流读文件 
            using (FileStream fsRead = new FileStream(@"D:\file\txt.html", FileMode.Open,FileAccess.Read,FileShare.Read))
            {
                int fsLen = (int)fsRead.Length;
                byte[] heByte = new byte[fsLen];
                int r = fsRead.Read(heByte, 0, heByte.Length);
                Encoding encode = System.Text.Encoding.GetEncoding("unicode");//以Unicode方式读取文件
                string myStr =encode.GetString(heByte);
                Console.WriteLine(myStr);
                Console.ReadKey();
            }

 

相关文章:

  • 2021-11-17
  • 2021-11-18
  • 2021-06-10
  • 2021-12-18
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2021-12-22
  • 2022-12-23
  • 2021-11-20
  • 2022-01-07
  • 2022-01-01
相关资源
相似解决方案