1.获取文件路径

2.编写读取路径文件信息

   private string ReadFileStream(string filePath)
        {
            string strContent = string.Empty;
            FileStream fs = new FileStream(filePath, FileMode.Open);
            byte[] buffer = new byte[fs.Length];
            fs.Read(buffer, 0, buffer.Length);


            strContent = Encoding.Default.GetString(buffer);
            fs.Close();
            return strContent;
        }


3.运行函数,返回当前文件返回的值。

相关文章:

  • 2022-12-23
  • 2022-03-04
  • 2021-12-16
  • 2021-05-27
  • 2021-12-13
  • 2021-06-02
  • 2021-10-08
猜你喜欢
  • 2021-05-03
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案