1

检索某些 sFTP 子目录列表时,我收到错误“错误数据包长度 xxxxx”。我的连接成功。FileZilla ftp 客户端(默认设置)与相同的目录具有完全相同的问题,但 CoreFTP Lite(默认设置)可以轻松列出所有目录。如果我移出一些文件,那么我可以列出子目录的内容。

我听说这可能是因为 sFTP 服务器允许 BOM 作为可选或其他东西......

SSH.NET C# 库(来自https://sshnet.codeplex.com/的最新版本)是否有任何解决方法。

foreach (var d in sftp.ConnectionInfo.Encryptions.Where(p => p.Key != "aes256-cbc").ToList())
    sftp.ConnectionInfo.Encryptions.Remove(d.Key);   // remove all Encryptions but the one listed above

sftp.ConnectionInfo.Encoding = System.Text.UTF8Encoding.ASCII;
sftp.Connect();  
var files = sftp.ListDirectory("/SubDirectory");  // Error Here

编辑: 正在连接到安全的 FTP 服务器:(SSH-2.01.36 Globalscape)

4

0 回答 0