如题!!

解决方案 »

  1.   

    void CDemoDlg::ftpConnect(CString ipaddr,CString user,CString pwd,const char * remote,const char * local)
    {
    CInternetSession* pSession;
    CFtpConnection* pConnection=NULL;
    CFtpFileFind* pFileFind=NULL;
    CString strFileName;
    UINT  CanDownFileNum = 0;
    USHORT ResltValue;
    CString str;

    ResltValue = 0;
    UpdateWindow(); UpdateWindow();
    pSession = new CInternetSession(AfxGetAppName(), 1, INTERNET_OPEN_TYPE_PRECONFIG  );
    try{
    pConnection = pSession->GetFtpConnection(ipaddr, user, pwd);
    }
    catch(CInternetException* e)
    {
    e->ReportError();
    e->Delete();
    pConnection = NULL;
    ResltValue = 0;
    delete pSession;
    return;
    } BOOL bResult = pConnection->GetFile(remote,local,TRUE,FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_BINARY,1);

    if(!bResult)
    AfxMessageBox("Get File Faild");
    else
    AfxMessageBox("Get File Success"); if (pConnection!=NULL)
    {
    pConnection->Close();
    delete pConnection;
    }
        delete pSession;
    }这是我用VC写的ftp下载,可是如何用进度条跟踪文件的大小情况,请大家给点好的建议!
    我不胜感谢!
      

  2.   

    如果你想要加上进度条,你就要自己用socket封装ftp协议了,然后根据发送和接收的数据包的数量,计算进度
      

  3.   

    CInetAPI也可以,看看这个:http://www.prim-tech.com/list.asp?id=57