gpt4 book ai didi

c# - "The handshake failed due to an unexpected packet format"FluentFTP连接SFTP服务器时出错

转载 作者:行者123 更新时间:2023-12-02 19:50:49 25 4
gpt4 key购买 nike

我正在尝试连接到 SFTP 服务器来下载一些文件。代码是用 C# 编写的,我使用 FluentFTP 连接到 FTP。客户端已将端口指定为 22。但是当我尝试以下代码时,出现错误

The handshake failed due to an unexpected packet format

任何使用 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 是一个完全不同的协议(protocol)。另请参阅Is "SFTP" and "FTP over SSL" a same thing?

您无法使用 FluentFTP 连接到 SFTP 服务器。您必须使用另一个SFTP库,请参阅SFTP Libraries for .NET .

关于c# - "The handshake failed due to an unexpected packet format"FluentFTP连接SFTP服务器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58167292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com