Possible Duplicate:
C# Reading a File Line By Line
How to loop over lines from a TextReader?
I am given a .NET TextReader (a class that can read a sequential series of characters). How can I loop over its content by line?
Do you mean something like this?
string line = null;
while((line = reader.ReadLine()) != null)
{
// do something with line
}