是否可以使用“被动模式”?使用 FtpWebRequest
我们制定了每晚将文件上传到合作伙伴 FTP 站点的流程。他们现在需要被动连接,而我们的上传现在失败。 .NET 4 FtpWebRequest 是否可以实现被动连接而不是主动连接?如果是这样,有人可以提供一个例子吗?
We have a process in place to upload a file nightly to a partner FTP site. They now require a passive connection and our uploads now fail. Is it possible for the .NET 4 FtpWebRequest to implement a passive connection instead of an active one? If so, can someone please provide an example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
设置
UsePassive
FtpWebRequest 上的属性设置为true
。Set the
UsePassive
property totrue
on the FtpWebRequest.只是在旧帖子中添加一些内容 - FtpWebRequest.UsePassive 属性默认为 True,因此所有请求都应该使用被动。
Just to add something to an old post - The FtpWebRequest.UsePassive property is True by default, so all requests should use passive already.
尝试在 FtpWebRequest 上设置
UsePassive
属性?请参阅 MSDN。Tried setting the
UsePassive
property on FtpWebRequest? See MSDN.