我正在编写一个应用程序,它允许我从远程服务器上传和下载文件。我使用sftp作为我的传输协议,我需要将所有文件和目录列出到一个listview中。我对sftp使用sharpssh。谁能给我指个方向?
感谢大家的支持,
Bas van Ooyen
发布于 2010-11-23 08:17:10
Sftp sftp = new Sftp(serverUri.Host, userName, password);
sftp.Connect();
//the foldername cannot be empty, or the listing will not show
ArrayList res = sftp.GetFileList("/foldername");
foreach (var item in res)
{
if (item.ToString() != "." && item.ToString() != "..")
Console.WriteLine(item.ToString());
}
sftp.Close();https://stackoverflow.com/questions/3088190
复制相似问题