Method DownloadFileAsync
DownloadFileAsync(SshClient, string, string, SshScpOptions?, CancellationToken)
Downloads the remote file remotePath to localPath (a file, or an existing directory to put it
in under the remote name).
public static Task DownloadFileAsync(this SshClient client, string remotePath, string localPath, SshScpOptions? options = null, CancellationToken cancellationToken = default)
Parameters
clientSshClientremotePathstringlocalPathstringoptionsSshScpOptionscancellationTokenCancellationToken
Returns
Exceptions
- SshException
The file does not exist, is a directory, or the transfer failed (TransferFailed).