我想把一个目录下的所有文件夹及文件夹下的文件都上传到ftp server上默认的目录下,
并且文件所在的相对目录不变,各位大侠给出出主义,

解决方案 »

  1.   

    很简单的,利用FTP的函数了。你仔细看一下他们全部用法,可以实现的。
      

  2.   

    创建一个ftp客户端程序
     
    The following table shows the steps you might perform in a typical FTP client application.
    A----Your goal             
    B----Actions you take                  
    C----Effects  
    1、
    A----Begin an FTP session. 
    B----Create a CInternetSession object. 
    C----Initializes WinInet and connects to server. 
    2、
    A----Connect to an FTP server. 
    B----UseCInternetSession::GetFtpConnection. 
    C----Returns aCFtpConnection object. 
    3
    A----Change to a new FTP directory on the server. 
    B----UseCFtpConnection::SetCurrentDirectory. 
    C----Changes the directory you are currently connected to on the server. 
    4
    A----Find the first file in the FTP directory. 
    B----UseCFtpFileFind::FindFile. Finds the first file. 
    C----Returns FALSE if no files are found. 
    5
    A----Find the next file in the FTP directory. 
    B----UseCFtpFileFind::FindNextFile. 
    C----Finds the next file. Returns FALSE if the file is not found. 
    6
    A----Open the file found by FindFile or FindNextFile for reading or writing. 
    B----UseCFtpConnection::OpenFile, using the file name returned byFindFile orFindNextFile.
    C----Opens the file on the server for reading or writing. Returns aCInternetFile object. 
    7
    A----Read from or write to the file. 
    B----UseCInternetFile::Read orCInternetFile::Write. 
    C----Reads or writes the specified number of bytes, using a buffer you supply. 
    8
    A----Handle exceptions. 
    B----Use theCInternetException class. 
    C----Handles all common Internet exception types. 
    9
    A----End the FTP session. 
    B----Dispose of theCInternetSession object. 
    C----Automatically cleans up open file handles and connections.