打漏了,是"服务器" 响应时反回的head数据如 contenttype 、location

解决方案 »

  1.   

    在OnDocumentComplete里面访问IHtmlDocument2接口得到
      

  2.   

    to jiangshengIHtmlDocument2得到的只是 html文档,不是服务器的响应头.
      

  3.   

    好像得不到的,你用wininet去从服务器取吧
      

  4.   

    HEAD能得到的都可以实现:比如你想获得文件最后修改的日期可以用HRESULT IHTMLDocument2::get_lastModified(BSTR *p);获得当前字符集:
    HRESULT IHTMLDocument2::get_defaultCharset(BSTR *p);获得cookie:(不属于head范畴,也铁出来把)
    HRESULT IHTMLDocument2::get_cookie(BSTR *p);而你说的content-type可以这样实现:CString CWebBrowser2::GetType()//based CWnd. USE CreateControl to Create IWebBrowser2's window
    {
    CString result;
    InvokeHelper(0xcd, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
    return result;
    }
    location更不用说了
    CHtmlView也提供了GetLocation函数
    或者你用
    HRESULT IHTMLDocument2::get_location(IHTMLLocation **p);获得refer
    HRESULT IHTMLDocument2::get_referrer(BSTR *p);哎呀,太多了,你自己看MSDN去吧!
    总之什么都行啊~~
      

  5.   

    不对啊,从论坛列表里看作者是111222
    从帖子里面看作者是pccrazy (淡泊) 这太离谱了吧!!!!!!!!!!