Files C#

using System.IO;

Read all lines in text file into array

var lines = File.ReadAllLines("/path/to/file.txt");

Read text file line by line

using (var s = new StreamReader("/path/to/file.txt"))
{
    while (true)
    {
        var line = await s.ReadLineAsync();
        if (line is null) break;
        Console.WriteLine(line);
    }
}