我有以下代码。无论我如何尝试,它都无法连接。
WebClient client = new WebClient();
client.Credentials = new NetworkCredential(Login, Password);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback =
(sender, cert,chain,error) => true;
client.UploadFile("MyhttpsLink", WebRequestMethods.Ftp.UploadFile,"D:\\test.csv");
1:预期结果:我需要将该文件上传到我的FTP链接
2:实际结果:其他信息:基础连接已关闭:连接意外关闭。