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.运行函数,返回当前文件返回的值。