您现在的位置:首页 >> VCL >> VCL >> 内容

Delphi动态的修改WebBrowser加载页面的内容

时间:2011/9/3 16:26:05 点击:

  核心提示:procedure DoChangePageCode(Doc: IDispatch);var tr: IHTMLTxtRange; s: string;begin tr := ((Doc as IHT...
 procedure DoChangePageCode(Doc: IDispatch);
 var
   tr: IHTMLTxtRange;
   s: string;
 begin
   tr := ((Doc as IHTMLDocument2).body as IHTMLBodyElement).createTextRange;
   s := tr.htmlText; // 取出页面的代码
   // 此处就能随意改了
   tr.pasteHTML(s); // 改完后的代码写回去
 end;

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号