TWebBrowser显示自定义Html内容

  1. uses
  2.   ActiveX, MSHtml;
  3.  
  4. var
  5.   Document: IHtmlDocument2;
  6.   V: OleVariant;
  7. begin
  8.   WebBrowser1.Navigate('about:blank');
  9.   Document := WebBrowser1.Document as IHtmlDocument2;
  10.   V := VarArrayCreate([0, 0], varVariant);
  11.   V[0] := 'Hello World';
  12.   Document.Write(PSafeArray(TVarData(v).VArray));
  13. end;
17fav 收藏本文
标签:, ,

相关日志 随机文章

Comments

3 Responses to “TWebBrowser显示自定义Html内容”

  1. feuvan on 2007-07-02 6:48 pm

    orz Delphi

    [Reply]

  2. bianbian on 2007-09-16 12:56 am

    不需要这么复杂的,为了OleVariant而引用一个ActiveX的unit太浪费了。我的经验是直接赋innerHTML值就行的:
    WebBrowser1.Navigate(’about:blank’);
    Document := WebBrowser1.Document as IHtmlDocument2;
    Document.body.innerHTML := ‘Hello World’;

    吗的,申讨一下这个验证码。要是同时开几篇文章回复必定都说验证码错。刚开始我还以为我TMD这么弱智了,都算错。

    [Reply]

  3. Sunshow on 2007-09-16 7:22 am

    按session来的肯定这样子了。。
    难道还用个临时表保存一下sessionid吗

    [Reply]

Leave a Reply




请输入验证码

Use "<coolcode></coolcode>" to publish your code.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

京ICP备05059555号

收藏 & 分享

Powered by 17fav.com