public static IList<string> ReadStreamAsLines(Stream stream)
{
List<string> lines = new List<string>();
using (StreamReader reader = new StreamReader(stream))
{
string line = null;
while ((line = reader.ReadLine()) != null)
{
lines.Add(line);
}
}
return lines;
}