Renci.SshNet.SftpClient.ReadAllLines C# (CSharp) Method

ReadAllLines() public method

Opens a file, reads all lines of the file with the specified encoding, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllLines ( string path, Encoding encoding ) : string[]
path string The file to open for reading.
encoding Encoding The encoding applied to the contents of the file.
return string[]
        public string[] ReadAllLines(string path, Encoding encoding)
        {
            var lines = new List<string>();
            using (var stream = new StreamReader(OpenRead(path), encoding))
            {
                while (!stream.EndOfStream)
                {
                    lines.Add(stream.ReadLine());
                }
            }
            return lines.ToArray();
        }

Same methods

SftpClient::ReadAllLines ( string path ) : string[]