防火墙阻止在我的filezilla服务器上传文件

本文关键字:服务器 文件 filezilla 我的 防火墙 | 更新日期: 2023-09-27 18:26:08

我正在尝试设置一个filezilla服务器。我已经按照这里的指示去做了。我写了一个简单的c#脚本,以便将数据上传到服务器。我的代码如下:

static void UploadFile(string filepath)
{
    string m_FtpHost = "ftp://ip:port/";
    string m_FtpUsername = "user";
    string m_FtpPassword = "pass";
    // Get an instance of WebClient
    WebClient client = new System.Net.WebClient();
    // parse the ftp host and file into a uri path for the upload
    Uri uri = new Uri(m_FtpHost + new FileInfo(filepath).Name);
    // set the username and password for the FTP server
    client.Credentials = new System.Net.NetworkCredential(m_FtpUsername, m_FtpPassword);
    // upload the file asynchronously, non-blocking.
    client.UploadFileAsync(uri, "STOR", filepath);
}

当我在同一台计算机上运行该脚本时,一切都很正常。当我尝试从同一局域网的另一台计算机上运行相同的脚本时,我遇到了问题。文件发送不正确。当我关闭防火墙时,上传正常进行。知道如何越过防火墙吗?

防火墙阻止在我的filezilla服务器上传文件

通常,当程序尝试使用任何端口时,Windows会要求用户授予程序权限(Windows get是一个弹出窗口,要求允许或禁止程序使用该端口)。。。我不知道该怎么做,但我找到了一个链接。。。

我不确定需要满足什么条件才能公开此对话框,我将假定一个应用程序尝试在上打开侦听端口普通的Windows实例应该始终显示此对话框。为什么?你不尝试将你的应用程序添加到"授权应用程序"中吗列表,或使用Windows防火墙COM手动打开端口interop(NetFwTypeLib)?

http://blogs.msdn.com/b/securitytools/archive/2009/08/21/automating-windows-firewall-settings-with-c.aspx

引用自alexw