using System.IO;
public string StreamReaderReadFile(string path)
{
string str="";
try
{
FileStream file = new FileStream(path, FileMode.Open);
StreamReader sr = new StreamReader(file);
string a = sr.ReadLine();
while ( a != null)
{
str += a;
a = sr.ReadLine();
}
//或者str = sr.ReadToEnd();
sr.Close();
}
catch
{}
return str;
}