【问题标题】:"Server cannot accept argument" exception thrown by FTP server in IIS in Azure VMAzure VM 中 IIS 中的 FTP 服务器引发“服务器无法接受参数”异常
【发布时间】:2017-03-01 04:57:01
【问题描述】:

按照我用来连接 FTP 服务器的代码。

client.Mode = FtpMode.Active;
client.ActiveModePorts = new Range(10000, 10001);
client.Connect(ftpModel.ftpServer, ftpModel.ftpPort);
client.Login(ftpModel.ftpUser, ftpModel.ftpPassword);

我正在使用 Ftp.dll nuget 包进行开发。

  1. Visual Studio 引发的错误

  1. FTP 防火墙支持

  1. 防火墙入站规则

  1. Azure VM 的入站规则

  1. 本地计算机中的入站规则

【问题讨论】:

    标签: c# azure iis ftp azure-virtual-machine


    【解决方案1】:

    在 Azure VM 中,我们无法在主动模式下使用 FTP,请尝试使用被动模式

    在主动模式 FTP 中,客户端从一个随机的非特权端口 (N > 1023) 连接到 FTP 服务器的命令端口 21。然后,客户端开始监听端口 N+1 并发送 FTP 命令 PORT N+1到 FTP 服务器。然后,服务器将从其本地数据端口(即端口 20)连接回客户端指定的数据端口。
    这里的连接出现如下:

    【讨论】:

      猜你喜欢
      • 2020-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-06
      • 2014-03-18
      • 2012-09-21
      • 1970-01-01
      相关资源
      最近更新 更多