c# 读取文件流
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.执行函数,返回当前文件返回的值。
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/69402.html