我正在尝试连接到 SFTP 服务器以下载一些文件。代码是用 C# 编写的,我使用 FluentFTP 连接到 FTP。客户端已将端口指定为 22。但是当我尝试以下代码时,出现错误
由于意外的数据包格式,握手失败
任何在 FluentFTP 上工作的人都可以向我建议我的代码中缺少什么。
FtpClient fclient = new FtpClient("xxx.yyy.com", "username", "password");
fclient.EncryptionMode = FtpEncryptionMode.Implicit;
fclient.SslProtocols = SslProtocols.Tls12;
fclient.Port = 22;
fclient.Connect();
谢谢。
FluentFTP 是 FTP(S) 客户端。
SFTP 是一个完全不同的协议。另请参阅“SFTP”和“FTP over SSL”是一回事吗?
您不能使用 FluentFTP 连接到 SFTP 服务器。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句