【发布时间】:2014-02-21 10:34:17
【问题描述】:
过去几天我一直在努力使用需要“CCC”命令的 FTPS 服务器,我试图通过 .Net 访问
我正在使用 AlexFTPS 库。我可以连接和协商 AUTH TLS,我可以更改目录,但是当我尝试列出目录或下载文件时,服务器会询问“CCC”命令。当我发送“CCC”命令时,我会收到“200 CCC 上下文已启用”回复,但随后我无法发送任何其他内容,只要我收到服务器超时异常。
我做了进一步的测试:
- WS_FTP:如果我选中“在 SSL 身份验证后使用未加密的命令通道”选项,则可以使用
- Filezilla:即使我将“CCC”添加为登录后命令也无法正常工作
- http://www.componentpro.com/ftp.net/ :有效但不是开源的
任何帮助将不胜感激......对不起,我不熟悉 FTP......
这是我的代码:
Using Client As New AlexPilotti.FTPS.Client.FTPSClient
AddHandler Client.LogCommand, Sub(sender As Object, args As AlexPilotti.FTPS.Common.LogCommandEventArgs)
Console.WriteLine(args.CommandText)
End Sub
AddHandler Client.LogServerReply, Sub(sender As Object, args As AlexPilotti.FTPS.Common.LogServerReplyEventArgs)
Console.WriteLine(args.ServerReply)
End Sub
Dim cred = New Net.NetworkCredential("login", "password")
Client.Connect("ftps.server.com", cred, AlexPilotti.FTPS.Client.ESSLSupportMode.CredentialsRequired)
Client.SendCustomCommand("SYST")
Client.SendCustomCommand("PBSZ 0")
Client.SendCustomCommand("PROT P")
Client.SendCustomCommand("FEAT")
Client.SendCustomCommand("PWD")
Client.SendCustomCommand("TYPE A")
Client.SendCustomCommand("PASV")
Client.SendCustomCommand("CCC")
Client.SendCustomCommand("LIST")
Console.ReadKey()
End Using
谢谢!
【问题讨论】: