|
Subject:
|
C#: EOF using StreamReader
|
|
Posted By:
|
shazia1
|
Post Date:
|
8/16/2005 4:25:10 AM
|
i m using StreamReader to read lines from my file i want to end reading till EOF is reached. Here is my code:
using (StreamReader sr = new StreamReader("TestFile.txt")) { String line; while ((line = sr.ReadLine()) != null) { Console.WriteLine(line); } }
Now the problem is that if there are any consecutive newlines in my file, the reader stops reading assuming that its end of file. How to cope up wid dis problem?
Thanks, Shazia.
|
|