Enumerate Lines for StreamReader
using System.Collections.Generic; public static class IOUtil { public static IEnumerable<string> EnumLines(System.IO.StreamReader fp) { while (!fp.EndOfStream) { var line = fp.ReadLine(); yield return line; } } }