关于webbrowser问题!很简单,但我不知道!!(100分)

  • 主题发起人 主题发起人 kuangren198512
  • 开始时间 开始时间
K

kuangren198512

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在想做一个关于webbrowser的软件,在做的过程中,我遇到了问题,如下:
我想取得一个网站中部分代码,得到之后还要让它在webbrowser中显示.
也就是说,就好象在一个网站中有这样代码:<div class=ptitle>about<span onclick=&quot;ToggleDisplay(dropdownid,20)&quot; onmouseover=&quot;this.style.cursor='hand'&quot;><img align=&quot;middle&quot; border=&quot;0&quot; id=&quot;dropdownid&quot; src=&quot;IMAGES/DIC/arr01.jpg&quot; alt=&quot;display/hide example sentences&quot;></span><br>KK: [<img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/018.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/053.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/038.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/002.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/015.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/039.GIF&quot;>]<br>DJ: [<img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/018.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/053.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/038.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/002.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/035.GIF&quot;><img border=0 align=absbottom src=&quot;IMAGES/DIC/PN/039.GIF&quot;>]</div><div class=pcixin>prep.</div><div class=pexplain>1. 关于,对于</div><div class=peng><span id=dropdownid>My mother often spoke to me <font class=engi>about</font> you.</span></div><div class=pchi><span id=dropdownid>家母常和我谈起你。</span></div><div class=pexplain>2. 在...的附近;在...的周围</div><div class=peng><span id=dropdownid>She sat up and looked <font class=engi>about</font> her.</span></div><div class=pchi><span id=dropdownid>她坐了起来,环顾四周。</span></div><div class=pexplain>3. 在...的身边</div><div class=peng><span id=dropdownid>I had no money <font class=engi>about</font> me.</span></div><div class=pchi><span id=dropdownid>我身边没有带钱。</span></div><div class=pexplain>4. 大约在...时候</div><div class=peng><span id=dropdownid>It happened <font class=engi>about</font> 5 o'clock in the morning.</span></div><div class=pchi><span id=dropdownid>这事发生在早晨约莫五点钟的时候。</span></div><div class=pexplain>5. 从事于</div><div class=peng><span id=dropdownid>What the hell are you <font class=engi>about</font>?</span></div><div class=pchi><span id=dropdownid>你到底在做什么?</span></div><div class=pexplain>6. 在...身上,在...的性格中</div><div class=peng><span id=dropdownid>What I like <font class=engi>about</font> him is his sense of humor.</span></div><div class=pchi><span id=dropdownid>我喜欢的是他的幽默感。</span></div><div class=pcixin>ad.</div><div class=pexplain>1. 在四周;到处</div><div class=peng><span id=dropdownid>She likes to walk <font class=engi>about</font>.</span></div><div class=pchi><span id=dropdownid>她喜爱四处走走。</span></div><div class=pexplain>2. 在附近,在近处</div><div class=peng><span id=dropdownid>There were few people <font class=engi>about</font>.</span></div><div class=pchi><span id=dropdownid>附近几乎无人。</span></div><div class=pexplain>3. 大约;几乎</div><div class=peng><span id=dropdownid>John is <font class=engi>about</font> the same age as Tom.</span></div><div class=pchi><span id=dropdownid>约翰和汤姆的年龄相仿。</span></div><div class=pexplain>4. 向相反方向</div><div class=peng><span id=dropdownid>The ship turned <font class=engi>about</font> midway.</span></div><div class=pchi><span id=dropdownid>船在中途掉转了航向。</span></div>
这样的代码,可以从一个网站中把div标签中的内容提取出来,让webbrowser显示.
问高手,可以告诉我吗?
我的邮箱:zhengyun1014@126.com
 
procedure ShowHtmlDirect(html: string);
var v: Variant;
HTMLDocument: IHTMLDocument2;
begin
v := VarArrayCreate([0, 0], varVariant);
v[0] := html;
HTMLDocument := WebBrowser.Document as IHTMLDocument2;
if Assigned(HTMLDocument) then
begin
HTMLDocument.Write(PSafeArray(TVarData(v).VArray));
HTMLDocument.Close;
end;
end;
 
那个HTMLDocument.Write(PSafeArray(TVarData(v).VArray));这句话不对呀!
不能通过!
 
里面的psafearray不可以编译
 
后退
顶部