以前看到个帖子这样来下在整个网页#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile") rename("BOF","FirstOfFile")
#include "icrsint.h"
void GetWholePage(LPCTSTR url,LPCTSTR name)
{
CoInitialize(NULL);
IMessagePtr iMsg(__uuidof(Message));

IConfigurationPtr iConf(__uuidof(Configuration));
iMsg->Configuration = iConf;
try
{
iMsg->CreateMHTMLBody(page_url,cdoSuppressNone,"domain\\username","password");
}
catch(_com_error err)
{
}
StreamPtr pStream = iMsg->GetStream;
pStream->SaveToFile(save_filename,adSaveCreateOverWrit);
CoUninitialize();
}
但是我用了怎么不好使,说以上那些东西未知。。是不是缺少了什么支持条件,请高手详细指点一下,给个下载整个网页的例子也好,小弟谢过

解决方案 »

  1.   

    没有那个#include "icrsint.h",误会,copy错了,请大家帮忙
      

  2.   

    再加上这2行试试
    #import "c:\Program Files\Common Files\Microsoft Shared\CDO\cdoex.dll" rename_namespace("CDO") raw_interfaces_only
    using namespace CDO;
      

  3.   

    这里有个例子“利用Winsock控件下载网页”:http://www.vcfan.com/vc/down_children.asp?child_name=kongjian_internet&page=22021 利用Winsock控件下载网页 202 详细
      

  4.   

    #import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
    #import <cdosys.dll> no_namespace rename("EOF", "EndOfFile")
    ............
    void CSavemhtDlg::OnOK() 
    {
    // save url as a single file, in fact I don't know if it is mht file, but it can be opened by IE, can someone tell me?
    CoInitialize(NULL);
    {
    IMessagePtr       iMsg(__uuidof(Message));
    IConfigurationPtr iConf(__uuidof(Configuration));
    iMsg->Configuration = iConf;
    try
    {
      iMsg->CreateMHTMLBody(
       "http://example.microsoft.com", 
       cdoSuppressNone,
       "domain\\username",
       "password");
    }
    catch(_com_error err)
    {
      // handle exception
    }
    _StreamPtr pStream=iMsg->GetStream();
    pStream->SaveToFile("test.mht",adSaveCreateOverWrite);
    }
    CoUninitialize();
    }
      

  5.   

    试试这个
    好像是masterz写的
    May you succeed!
      

  6.   

    请问怎么样编程得到asp网页中的内容。http://expert.csdn.net/Expert/topic/1936/1936638.xml?temp=.9166681这个是masterz写的!向masterz学习!