FtpWebRequest ReqFTP = (FtpWebRequest)WebRequest.Create(new Uri("ftp://" + ftpServerIp + "/"));
ReqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
ReqFTP.UseBinary = true;
ReqFTP.AuthenticationLevel = System.Net.Security.AuthenticationLevel.MutualAuthRequested;
ReqFTP.Credentials = new NetworkCredential(ftpUserName, ftpPwd);
ReqFTP.KeepAlive = true; using (FtpWebResponse response = (FtpWebResponse)ReqFTP.GetResponse())
{ }如果服务端返回的消息是中文,这份代码肯定出错,据查是微软的一部BUG。但是现在很多服务器,比如一些虚拟空间,我们是不能左右虚拟空间服务商说要把登录返回的消息改为英文的。如果非要用.NET开发FTP客户端程序,又能针对中或英文的返回消息,有什么好的解决方案?
http://hi.baidu.com/tewuapple/item/39524e104673b2473a176e12http://blog.sina.com.cn/s/blog_3f5223010100gihj.htmlhttp://blog.csdn.net/yefanqiu/article/details/1563904
不怀疑我已人云亦云。我再想表达一个疑问是为何FlashFXP不会出现这样的情况?我不知道是不是FlashFXP本身可以兼容规范以为的支持?
客户端 .Net Framework 3.5/4.0
全部通过。
虽然看到的欢迎信息都是乱码,但是程序没有出错