public static IEnumerable<string> ReadLines(this WebResponse webRes) { using (var stream = webRes.GetResponseStream()) using (var reader = new StreamReader(stream)) { string line; while ((line = reader.ReadLine()) != null) { yield return line; } } }