If you need to read a text file by line, you can use the System.io.StreamReader object and its PEEK and READLINE methods, such as the following example:
Private void ReadtextFile (String FileName)
{
// Open and read the text file line by line
StreamReader Srfile = New StreamReader (filename, true);
While (srfile.peek ()> -1) // Check Eof
{
String sline = srfile.readline (); // r on line
// ...
}
Srfile.close ();
}