<分区>
我正在寻找一个免费的 SFTP 客户端。它还应该有一个免费的 dll,我可以使用它编写代码来在 C#(.NET 框架)中上传和下载文件。
例如下面的代码不是免费的,它有 30 天免费评估,我想要免费的,
Chilkat.SFtp sftp = new Chilkat.SFtp();
bool success;
success = sftp.UnlockComponent("Anything for 30-day trial");
sftp.ConnectTimeoutMs = 5000;
sftp.IdleTimeoutMs = 10000;
int port;
string hostname;
hostname = "www.my-ssh-server.com";
port = 22;
success = sftp.Connect(hostname,port);
success = sftp.AuthenticatePw("myLogin","myPassword");
success = sftp.InitializeSftp();
string handle;
handle = sftp.OpenFile("hamlet.xml","readOnly","openExisting");
success = sftp.DownloadFile(handle,"c:/temp/hamlet.xml");
success = sftp.CloseHandle(handle);
MessageBox.Show("Success.");