c# - FTPWeb 请求.NET 3.5 与 4

标签 c# .net ftp ftpwebrequest

我有一个与 IBM 大型机建立 FTP 连接的应用程序,并且一切正常。然后我针对 .NET 4 重新编译,大型机不再接受该文件,给我一条错误消息,指出该文件不存在,或者我没有权限。

这是我用来发送文件的:

Ftp = (FtpWebRequest)FtpWebRequest.Create(FtpAddress + "%2F'" + "EM.MOM.FIMSDATA" + ".AA." + "RR(+1)" + "'");

Microsoft 是否更改了 .NET 3.5 和 4 之间的任何内容,因为这指向框架更改?

最佳答案

我在 Microsoft 上找到了这个。

The cause of this issue is due to a behavior change in the System.Net.FtpWebRequest class in .Net Framework 4. There has been a change made to the System.Net.FtpWebRequest class from .Net Framework 3.5 to .Net Framework 4 to streamline the use of the CWD protocol commands. The new implementation of the System.Net.FtpWebRequest class prevents the send of extra CWD commands before issuing the actual command which the user requested and instead directly sends the requested command. For fully RFC compliant FTP servers, this should not be an issue, however for non-fully RFC compliant servers, you will see these types of errors.

解决方案是: http://support.microsoft.com/kb/2134299

关于c# - FTPWeb 请求.NET 3.5 与 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6251169/

相关文章:

c# - 如何在游戏中拥有局部位置和全局位置

c# - 查找 Dns.GetHostEntry 返回的正确 IP 地址

.net - 随着扩展方法的出现,抽象类的吸引力是否降低了?

python - PIL.Image.save() 到 FTP 服务器

c - 如何使用 c 套接字 api 发送文件。

c# - 最大长度输入属性的最大长度注释

java - Android 中 SQLite 数据库的安全性

c# - 为什么这种线程化方法不起作用?

c# - 即使 AllowAutoRedirect = true,HttpClient 也不会重定向

php ftp_get() 返回权限被拒绝