想法很简单 输入一个网页地址然后得该页面的所有连接地址~   能不能不通过ie来获得?
如果我想获得该页的html文件  能否也不通过ie?接口是什么?   我看过一个代码但是是vc7写的   我没有办法编译?
最好是有可以编译的[email protected]谢谢~

解决方案 »

  1.   

    获得 HTML 文件很简单, HTTP 协议 下载就是了. 要得到此网页内的所有连接地址,那得分析源代码了
    这里需要分解各种标签. 这个就比较复杂了
      

  2.   

    you can study walkall sample in msdn
    http://msdn.microsoft.com/downloads/samples/internet/browser/walkall/default.asp
      

  3.   

    BOOL GetUrlBuf(CString strUrl, CString &strRetBuf)
    {
    if(strUrl == "")
    return FALSE;strRetBuf = "";CInternetSession session;
    CInternetFile* file = NULL;try
    {
    file = (CInternetFile*) session.OpenURL(strUrl); 
    }
    catch (CInternetException* m_pException)
    {file = NULL; 
    m_pException->Delete();
    return FALSE;
    } if (file)
    {
    CString somecode;
    while (file->ReadString(somecode) != NULL) 
    {
    strRetBuf += somecode;
    }file->Close();
    delete file;
    }
    else
    {
    return FALSE;
    }return TRUE;
    }
      

  4.   

    用 MSHTML 的 IHTMLDocument2 的 get_links 获取 IHTMLElementCollection 接口,通过 IHTMLElementCollection 来获取 IHTMLAnchorElement,再通过 IHTMLAnchorElement 接口的get_href 我们就可以得到网页的所有链接了。参考文章:一个从网页tag里面分析url和url标题的类
    http://www.vckbase.com/document/viewdoc/?id=1196