那位高手能提供下面几个函数的使用例子InternetOpen 初始化 Win32 internet 
InternetConnect 打开一个FTP, HTTP, or Gopher 应用会话 
FtpCreateDirectory 在服务器上建立一个新的目录 
FtpRemoveDirectory 删除服务器上的一个目录 
FtpOpenFile 打开服务器上的一个文件进行读写 
FtpGetFile 接收指定的文件并且在本地建立它 
FtpPutFile 发送指定文件到服务器 
FtpDeleteFile 删除服务器上一个指定的文件 
FtpSetCurrentDirectory 设置服务器上当前的工作目录 
FtpGetCurrentDirectory 返回服务器当前的工作目录 
FtpCommand 发送命令到服务器 
FtpFindFirstFile 返回文件信息。放在 WIN32_FIND_DATA 结构中 
InternetFindNextFile 调用 FtpFindFirstFile()后在目录中连续查找 
FtpRenameFile 修改服务器上指定的文件的名字  

解决方案 »

  1.   

    在msdn上搜一下吧,上面有使用的例子的
    比如搜一下FtpCreateDirectory这个函数
    就看到了一个例子Creating a Synchronous Example
    Suppose that you want to connect to an FTP server called ftp://ftp.infosite.com and copy all of the .ZIP files from its /BIN subdirectory to your local hard drive and store them in your C:\ZIPFILES subdirectory. The sample code might look like this:HINTERNET hInternetSession;          // handle to internet connection
    HINTERNET hFTPSession;               // handle to FTP session
    HINTERNET hFileConnection;           // handle to file enumeration
    WIN32_FIND_DATA sWFD;                // structure to hold FIND data
    BOOL bResult = TRUE;                 // Boolean for return code
    CString InputSpec;                   // variable to hold input spec
    Cstring OutputSpec;                  // variable to hold output spechInternetSession = InternetOpen(
                      "Microsoft Internet Explorer",     // agent
                      INTERNET_OPEN_TYPE_PROXY,          // access
                      "ftp-gw",                          // proxy server
                      NULL,                              // defaults
                      0);                                // synchronous// Make connection to ftp server.
    hFTPSession = ::InternetConnect(
             hInternetSession,                // Handle from a previous
                                              // call to InternetOpen.
             "ftp://ftp.infosite.com",        // Server we want to connect to
             INTERNET_INVALID_PORT_NUMBER,    // Use appropriate port.
             NULL,                            // Use anonymous for username.
             NULL,                            // Use e-mail name for password
             INTERNET_SERVICE_FTP,            // Flag to use FTP services
             0,                               // Flags (see SDK docs)
             0);                              // Synchronous mode// Find first .ZIP file.
    hFileConnection = ::FtpFindFirstFile(
                        hFTPSession,
                        "*.ZIP",
                        &sWFD,
                        0,
                        0);
    if (hFileConnection != (HINTERNET)NULL)
       {
       ::FtpSetCurrentDirectory(hFTPSession, "/BIN");   while (bResult)
          {
          // Create file specs.
          InputSpec = "ftp://ftp.infosite.com/BIN/";
          InputSpec = InputSpec + sWFD.cFileName;
          OutputSpec = "c:\zipfiles\";
          OutputSpec = OutputSpec + sWFD.cFileName;      // Transfer the file.
          bResult = ::FtpGetFile(
             hFTPSession,
             InputSpec,
             OutputSpec,
             FALSE,
             FILE_ATTRIBUTE_NORMAL,
             FTP_TRANSFER_TYPE_BINARY,
             0);      // Get next file.
          bResult = ::InternetFindNextFile(
                      hFileConnection,
                      &sWFD);
          }
       }// Close connections.
    InternetCloseHandle(hFileConnection);
    InternetCloseHandle(hFTPSession);
    InternetCloseHandle(hInternetSession);