C# > Files > File Class > OpenText
Open text file for reading line by line.
Example
Read fast text file line by line C#
Read fast text file line by line C#
using (StreamReader sr = File.OpenText(@"c:\filename.txt"))
{
while (!sr.EndOfStream)
{
sr.ReadLine();
}
}
}