public static GetList ( string host, string folder, string userName, string password ) : IEnumerable |
||
host | string | |
folder | string | |
userName | string | |
password | string | |
Résultat | IEnumerable |
public static IEnumerable<SftpFile> GetList(string host, string folder, string userName, string password)
{
using (var sftp = new SftpClient(host, userName, password))
{
sftp.ErrorOccurred += Sftp_ErrorOccurred;
sftp.Connect();
var toReturn = sftp.ListDirectory(folder).ToList();
sftp.Disconnect();
return toReturn;
}
}