unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, SHDocVw;type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; procedure WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); var HtmlCode: String; begin if (pdisp as IWebBrowser2).Document = WebBrowser1.Document then //初始化成功后执行 begin HtmlCode := WebBrowser1.oleobject.Document.Body.InnerHTML; //先读出源码 WebBrowser1.oleobject.Document.Body.InnerHTML := HtmlCode; //写入WebBrowser1控件. WebBrowser1.Visible := True; //加载完后显示它 end; end;procedure TForm1.Button1Click(Sender: TObject); begin WebBrowser1.Visible := False; //先隐藏它 WebBrowser1.Navigate('http://www.niudun.net'); //初始化,并且加载链接标记http://www.niudun.net的源码 end;end.
Implement IServiceProvider (Delphi6: ActiveX.pas) to get the QueryService function call. Return your : IInternetHostSecurityManager or IInternetSecurityManager or IInternetSecurityMgrSite or IInternetZoneManager
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw;type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
Button1: TButton;
procedure WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
var
HtmlCode: String;
begin
if (pdisp as IWebBrowser2).Document = WebBrowser1.Document then //初始化成功后执行
begin
HtmlCode := WebBrowser1.oleobject.Document.Body.InnerHTML; //先读出源码
WebBrowser1.oleobject.Document.Body.InnerHTML := HtmlCode; //写入WebBrowser1控件.
WebBrowser1.Visible := True; //加载完后显示它
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Visible := False; //先隐藏它
WebBrowser1.Navigate('http://www.niudun.net'); //初始化,并且加载链接标记http://www.niudun.net的源码
end;end.
function call.
Return your :
IInternetHostSecurityManager
or IInternetSecurityManager
or IInternetSecurityMgrSite
or IInternetZoneManager
并公布SecurityManager接口对象