您的位置:首页 > 运维架构 > 网站架构

网站源代码获得方法

2009-12-15 14:17 253 查看
AnsiString TForm1::WEB2HTMLCode()
{
extern AnsiString str_CurrPath;
AnsiString strCode;
IHTMLDocument2 *HTMLDocument = NULL;
if(SUCCEEDED(CppWebBrowser1->Document->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&HTMLDocument)))
{
IHTMLElement *pElement = NULL;
HTMLDocument->get_body(&pElement);
if (pElement)
{
WideString str;
pElement->get_innerHTML(&str);

strCode=AnsiString(str);
strCode=replaceElement(strCode,"amp;","");
strCode=replaceElement(strCode," "," ");
pElement->Release();
}
HTMLDocument->Release();
}
return strCode;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐