2008年(5645)
分类:
2008-04-28 14:21:45
运用StreamReader从一个标准的文本文件读行信息。
以下为引用的内容: StreamReader srReadLine = new StreamReader( (System.IO.Stream)File.OpenRead("C:\\Temp\\Test.txt"), System.Text.Encoding.ASCII); srReadLine.BaseStream.Seek(0, SeekOrigin.Begin); while (srReadLine.Peek() > -1) { Console.WriteLine(srReadLine.ReadLine()); } srReadLine.Close(); |
运用StreamReader从一个标准的文本文件读行信息。
以下为引用的内容: StreamReader srReadLine = new StreamReader( (System.IO.Stream)File.OpenRead("C:\\Temp\\Test.txt"), System.Text.Encoding.ASCII); srReadLine.BaseStream.Seek(0, SeekOrigin.Begin); while (srReadLine.Peek() > -1) { Console.WriteLine(srReadLine.ReadLine()); } srReadLine.Close(); |