There exists a File.ReadAllLines
but not a Stream.ReadAllLines
.
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestR
If you want to use StreamReader then yes, you will have to use ReadLine and loop throught the StreamReader, reading line by line.
Something like that:
string line;
using (StreamReader reader = new StreamReader(stream))
{
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
or try
using (StreamReader reader = new StreamReader("file.txt"))
{
string[] content = reader.ReadToEnd().Replace("\n","").Split('\t');
}