I came across an implementation of reading a file line by line that looks like this:
using (StreamReader reader = File.OpenText(path))
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
}
However personally I would do just this:
foreach (string line in File.ReadLines(path))
{
}
Is there any reason to pick one over the other?