asp.net中有没有跟php的file_get_contents() 一样性质的函数
asp.net中有没有跟php的file_get_contents() 一样性质的函数 --------------------编程问答-------------------- --------------------编程问答-------------------- 用StreamWriterstring path = @"c:\temp\MyTest.txt";
if (!File.Exists(path))
{
// Open the file to read from.
using (StreamReader sr = File.OpenText(path))
{
string s = "";
while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
补充:.NET技术 , ASP.NET