Мне надоел приведенный ниже код, но он загружает файл в мою локальную папку.< /p>
Код: Выделить всё
using (Sftp client = Login())
{
if (client.IsConnected)
{
// check if local directory exists, if no, create
if (!Directory.Exists(localDirectory))
{
Directory.CreateDirectory(localDirectory);
}
client.Download($"{remoteDirectory}/*", $"{localDirectory}", TraversalMode.MatchFilesShallow, transferMethod, ActionOnExistingFiles.OverwriteAll);
client.Disconnect();
sftpDownloadFileResponse.Message = $"File successfull to download
from SFTP {_host} Server";
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... in-c-sharp
Мобильная версия