Method ReadAllTextAsync
ReadAllTextAsync(string, Encoding?, CancellationToken)
Reads a whole remote file as text, as ReadAllTextAsync(string, Encoding, CancellationToken) does locally: a
byte order mark, if there is one, decides the encoding; otherwise encoding (UTF-8 by default).
public Task<string> ReadAllTextAsync(string path, Encoding? encoding = null, CancellationToken cancellationToken = default)
Parameters
pathstringencodingEncodingcancellationTokenCancellationToken
Returns
Exceptions
- SftpException
The file does not exist (NoSuchFile), or another error.