活动模式在FTP中不起作用 [英] Active mode not working in FTP

查看:115
本文介绍了活动模式在FTP中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个Filezilla服务器,我想使用主动模式下载文件,但默认情况下它是被动的。



Hi i have a Filezilla server, i want to download files using active mode, but by default it takes passive.

public FtpWebRequest GetRequest(string URI)
        {

            FtpWebRequest result = ((FtpWebRequest)(FtpWebRequest.Create(URI)));
          
            result.Credentials = GetCredentials();

            result.KeepAlive = false;

            if (isEnableSsl)
            {
                result.EnableSsl = true;

                ServicePointManager.
                            ServerCertificateValidationCallback = new
                               RemoteCertificateValidationCallback
                               (ValidateServerCertificate);
            }
            return result;

        }





和在filezilla服务器上我的日志显示PASV

这里是我登录filezilla





and on filezilla server my logs showing PASV
here is my log on filezilla

(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.40 beta
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> USER tmp
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> 331 Password required for tmp
(000597)07-01-16 16:39:09 PM - (not logged in) (127.0.0.1)> PASS *******
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 230 Logged on
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> OPTS utf8 on
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 200 UTF8 mode enabled
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> PWD
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 257 "/" is current directory.
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> CWD CFM
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 250 CWD successful. "/CFM" is current directory.
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> TYPE I
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 200 Type set to I
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> PASV
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,248,44)
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> LIST
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 150 Connection accepted
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 226 Transfer OK
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> QUIT
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> 221 Goodbye
(000597)07-01-16 16:39:09 PM - tmp (127.0.0.1)> disconnected.









请帮助其紧急





please help its urgent

推荐答案

您好,



请仔细阅读本文,其中介绍了如何使用主动模式。



被动(EPSV或PASV)FTP连接的网络分析。 - Developer Support透视图中的提示和技巧。 - 网站首页 - MSDN博客 [ ^ ]



你可以通过这个。我希望它会对你有所帮助。

谢谢
Hi,

Please go through this article where explained about how to use active mode.

A network analysis of passive (EPSV or PASV) FTP connection. - Tips and tricks from a Developer Support perspective. - Site Home - MSDN Blogs[^]

you can go through this. I hope it will help you.
thanks


设置 FtpWebRequest.UsePassive Property [ ^ ]为false:

Set the FtpWebRequest.UsePassive Property[^] to false:
result.UsePassive = false;


您能告诉我如何实施这在C#?
Could you please tell me how to implement this in C# ?


这篇关于活动模式在FTP中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆