我用CHttpFile类的函数QueryInfo将对方网页的源代码全保存下来了,对其中的img标签进行解吸,知道图片在对方web服务器的哪个目录,现在问题是我怎么通过函数能把这些图片下载到本机,求救

解决方案 »

  1.   

    HTTP服务器上下载文件 
    http://www.cnitblog.com/wangk/archive/2005/12/31/5942.html
      

  2.   

    URLDownloadToFile
    or make another http request
      

  3.   

    BOOL Cxxx::URLDownloadToFile(const CString strSourecUrl, const CString strLocalDest)
    {
    if (::URLDownloadToFile(NULL, strSourecUrl, strLocalDest, 0, NULL ) != S_OK )
    {
    return FALSE;
        } return TRUE;
    }
      

  4.   

    HRESULT URLDownloadToFile(
      LPUNKNOWN pCaller,  // Caller's controlling IUnknown
      LPCWSTR szURL,      // Pointer to URL to be downloaded
      LPCTSTR szFileName, // Pointer to file name
      DWORD dwResv,       // Reserved for future use
      LPBINDSTATUSCALLBACK lpfnCB
                          // Caller's IBindStatusCallback
    );
     
    Parameters
    pCaller 
    [in] Pointer to the caller's controlling IUnknown. If the caller is not an ActiveX component, this value may be set to NULL. 
    szURL 
    [out] Pointer to the URL to be downloaded. Cannot be NULL. 
    szFileName 
    [out] Pointer to the name of the file returned by this function. The user should pass a buffer to be filled and, preferably, use MAX_PATH to allocate the maximum path size. 
    dwResv 
    [in] Reserved for future use; must be zero. 
    lpfnCB 
    [in] Pointer to the caller's IBindStatusCallback interface. Can be NULL. 
    msdn上面说可以使用lpfnCB来监测进度等信息,如果不让它为NULL,该如何使用呢?谢谢大侠。