FluentFTP下载文件报错

错误提示 :由于远程方已关闭传输流,身份验证失败?

client = new FtpClient("127.0.0.1");
client.Credentials = new NetworkCredential("test1", "123456");
client.EncryptionMode = FtpEncryptionMode.Explicit;

client.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
client.Connect();


string localPath = @"D:\work\document\临时信息1.txt";
string remotePath =@"/临时信息.txt";
client.DownloadFile(localPath, remotePath);
---报错:由于远程方已关闭传输流,身份验证失败

图片说明

解决方法:

client.Connect();

换成:

client.AutoConnect();

我也不知道为什么,关于这个方法的解释如下
图片说明
and
图片说明

供后人参考

看看是不是防火墙阻止了网络的连接造成错误。