ie,ie,ie,哎,可爱可恨的东西(300分)

  • 主题发起人 主题发起人 DNChen
  • 开始时间 开始时间
以下代码我在Delphi6 和 Windows2000 环境下调试通过。


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,mshtml,SHdocvw, OleCtrls, SHDocVw_TLB;

type
TForm1 = class(TForm)
Button1: TButton;
WebBrowser1: TWebBrowser;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
VAR
name,feature,replace:olevariant;
tempdoc:IHTMLdocument2;

Begin
name:='';
feature:='';
replace:=true;
tempdoc:= WebBrowser1.Document as IHTMLdocument2 ;
tempdoc.open('http://www.htxx.com.cn',name,feature,replace);
End;

procedure TForm1.FormCreate(Sender: TObject);
begin
webbrowser1.Navigate('http://www.greatall.com');
end;

end.
 
后退
顶部