none
FTP服务器端如何开发? RRS feed

  • 问题

  • 想通过客户端传过来的FTP命令来对服务端的情况进行处理,但不知道客户端的程序解析和命令的对应关系是怎么对应的?(例:客户端的什么函数会被解析为list命令)希望知道的朋友给点建议或思路,先谢了。
    2009年6月22日 10:35

答案

全部回复

  • FTP是标准,服务器不应该编写非标准的代码。客户端对标准实现属于客户端的实现细节,和服务器无关。
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
    Visual C++ MVP
    2009年6月22日 17:35
    版主
  • 您可以参照公开源码的FileZilla Server和client的源代码来研究需要的部分的。
    具体查看http://filezilla-project.org/download.php?type=client
    如果问题没有解决,还请继续跟帖讨论。
    2009年6月23日 1:01
  • 我的标题可能和我真正的问题有点差别,我的问题是如何知道客户端的函数会被解析成什么FTP命令,即USER PI的处理过程,list,RMD,SIZE客户端的FTP命令和发送数据的API之间的对应关系。
    2009年6月23日 2:15
  • 这个服务器不会知道的吧?FTP协议里面没有这类信息的格式。
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
    Visual C++ MVP
    2009年6月23日 2:39
    版主
  • 在Codeproject找到了一个FTP服务器的源码,但他是把客户端传过来的命令作为条件来进行处理的,附上连接http://www.codeproject.com/KB/IP/ftpserver.aspx,代码中有个命令解析的函数。问题是他怎么知道客户端会传给服务器什么命令?找不到有关命令解析方面的资料,蒋老大能说一下在哪能找到这方面的资料。
    2009年6月24日 2:41
  • 命令必须是FTP协议中规定的服务器才可以识别。如果你要知道客户端可能发送什么命令,去看FTP协议规范。
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
    Visual C++ MVP
    2009年6月24日 13:01
    版主
  • 谢谢蒋老大的回答,对我很有启发。能否给点FTP客户端FTP协议中User PI的资料,想知道他是怎么解析的?例子CFtpConnection ftp;ftp.PutFile();想知道putfile会被解析成什么FTP命令或哪些FTP命令的组合,希望蒋老大能给点建议或给点资料。

    2009年6月26日 1:28
  • 。。。。    你看一个ftp  上传工具   在log文件滚动的文本中  是有命令对应的阿


    紫柔版主的头像真叫萌得一个不行啊。。。。
    答案800 撒花
    2009年6月26日 3:46
  • 我是想知道他的解析原理,难道真的没有一点蛛丝马迹?

    2009年6月26日 9:00
  • MFC的源代码安装了的话,调试的时候可以跟踪进MFC的源代码去看看到底做了些什么
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
    Visual C++ MVP
    2009年6月26日 13:20
    版主