当前位置:编程学习 > C#/ASP.NET >>

asp.net中有没有跟php的file_get_contents() 一样性质的函数

asp.net中有没有跟php的file_get_contents() 一样性质的函数 --------------------编程问答-------------------- --------------------编程问答-------------------- 用StreamWriter 

 string 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
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,