http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=38234
用以下的指令直接將HTML資料傳給WEBBROWSER,而不要產生HTML檔案
代碼: 選擇全部
procedure Tform1.Button1Click(Sender: TObject);
var
vv: Variant;
HTMLDocument: IHTMLDocument2;
tmpStr,tmpfilepath:string;
src:string;
begin
src:='<a href="<a href=http://delphi.ktop.com.tw">Delphi target=_blank>http://delphi.ktop.com.tw">Delphi</a> K.Top討論區</a>';
vv := VarArrayCreate([0,0],varVariant);
vv[0] := src;
HTMLDocument := webbrowser1.Document as IHTMLDocument2;
HTMLDocument.write(pSafearray(TVarData(vv).VArray));
HTMLDocument.close;
end;