解决方案 »

  1.   

    /////////////////////////////////////////////////////////////////////
    //FTP download
    /////////////////////////////////////////////////////////////////////
    #include <windows.h>
    #include <wininet.h>
    #pragma comment(lib,"wininet")
    #include <stdio.h>
    char aa[1024];char bb[1024];char cc[1024];
    HANDLE m_hSession,hC,hF;
    long  ftpdownload (LPCTSTR lpszserver,LPCTSTR lpszfilepath,LPCTSTR lpszsavepath);int main()
    {
    printf("download from netscape.com\n");
      //ftp://ftp.netscape.com/pub/sdk/plugin/windows/oct_21_97/winNPSDK.zip
    //ftp://ftp.netscape.com/pub/sdk/help/windows/onefull.zip
    ftpdownload("ftp.netscape.com","pub/sdk/help/windows/onefull.zip","z.zip");
       return 1;
    }
    long ftpdownload (LPCTSTR lpszserver,LPCTSTR lpszfilepath,LPCTSTR lpszsavepath)
    {
          m_hSession=InternetOpen("MSDN ",0,0,0,0);
          hC=InternetConnect(m_hSession,lpszserver,
            0,"anonymous","[email protected]",INTERNET_SERVICE_FTP,0,0) ;
          MessageBox(0,"connected with server","info",0);
          hF=FtpOpenFile(hC,lpszfilepath,GENERIC_READ,
                                             FTP_TRANSFER_TYPE_BINARY ,0);
          char * m_buffer = new char[712+1] ;
          DWORD dwBytesRead=0 ;
      DWORD dwtotal=0;
      BOOL bRead;
      FILE* fp=fopen(lpszsavepath,"w+b");
      do
      {
      dwBytesRead=0;
      bRead=InternetReadFile(hF,m_buffer,712,&dwBytesRead);
      if(dwBytesRead>0)
      {
    dwtotal+=dwBytesRead;
    fwrite(m_buffer,dwBytesRead,1,fp);
      }
      }
      while(dwBytesRead>0);
      fclose(fp);
      delete m_buffer;
          sprintf(aa,"session end ,InternetReadFile dwBytesRead %ld bRead %d",dwtotal,bRead);
          MessageBox(0,aa,aa,0);
    return 0;
    }
      

  2.   

    给你发了。这里也有:
    http://asp.6to23.com/vcprogram/source/source_right.asp
      

  3.   

    别把我的信箱撑破了;Dmasterz() 老大,如雷灌耳啊
    可惜你给的是inetnet的 xuying() , mfkzj() 你们来的迟了点哦peon,周一在非技术区给你分,下班了,走人
    大家周末愉快