我一直在挖掘大量关于如何在 C# 中正确登录 FTP 的帖子,但当我真正尝试时,它不起作用。通过我的阅读,我开始认为这是因为我的用户名中有“at”符号。这是真的还是有其他问题?我可以使用 FileZilla 登录,没有问题。
var file = f.Element("FILE_PATH").Value;
string ftpHost = "myFTP.com";
var URI = @"ftp://" + ftpHost + "/download/" + file;
FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(URI);
ftp.Credentials = new NetworkCredential(@"[email protected] /cdn-cgi/l/email-protection", "Password");
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.DownloadFile;
FtpWebResponse ftpResponse = (FtpWebResponse)ftp.GetResponse();
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)