There exists a File.ReadAllLines but not a Stream.ReadAllLines.
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestR
Using the following extension method:
public static class Extensions
{
public static IEnumerable ReadAllLines(this StreamReader reader)
{
string line;
while ((line = reader.ReadLine()) != null)
{
yield return line;
}
}
}
It's possible to get to your desired code:
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Test_Resources.Resources.Accounts.txt"))
using (StreamReader reader = new StreamReader(stream))
{
string[] result = reader.ReadAllLines().ToArray();
}