尝试通过代码连接到FTP时,无法识别URI前缀错误,但是当我使用FileZilla尝试使用URI前缀时,这没问题,
这是代码。
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
FtpWebRequest ftpWebRequest = (FtpWebRequest)WebRequest.Create("ftps://test.rebex.net:990");
ftpWebRequest.UseBinary = true;
ftpWebRequest.UsePassive = true;
ftpWebRequest.Method = WebRequestMethods.Ftp.ListDirectory;
ftpWebRequest.EnableSsl = false;
ftpWebRequest.Credentials = new NetworkCredential(CurFedonomicsSetup.Current.FTPUserName, CurFedonomicsSetup.Current.FTPPassword);
client.Encoding = Encoding.UTF8;
ftpWebRequest.GetResponse();