C# IO操作磁盘上的txt
2015-07-28 14:45 Evan.Pei 阅读(234) 评论(0) 编辑 收藏 举报using System.IO;
//写入并导出到磁盘 StreamWriter sw = new StreamWriter(@"H:\text.txt"); sw.WriteLine("ABC"); sw.WriteLine("测试"); sw.WriteLine(123); sw.Close(); //读取txt StreamReader sr = new StreamReader(@"H:\text.txt"); Response.Write(sr.ReadLine() + "</br>"); Response.Write(sr.ReadLine() + "</br>"); Response.Write(sr.ReadLine() + "</br>");