我在尝试连接到FTP时收到URI前缀无法识别的错误

时间:2019-10-15 14:12:00

标签: c# ftp

尝试通过代码连接到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();

0 个答案:

没有答案