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;
}

相关文章:

  • 2022-02-07
  • 2021-12-16
  • 2022-01-17
  • 2021-12-24
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2021-11-27
  • 2021-12-05
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案