- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi打开网址链接的四种方法
用默认浏览器打开,uses shellapi}
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(Application.Handle, nil, 'http://www.3464.com', nil, nil, SW_SHOWNORMAL);
end;
{以下三种用IE浏览器打开}
{uses shellapi}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open','Iexplore.exe','http://www.3464.com',nil,SW_SHOWNORMAL);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(Application.Handle, nil, 'http://www.3464.com', nil, nil, SW_SHOWNORMAL);
end;
//uses SHDocVw;
procedure TForm1.Button4Click(Sender: TObject);
var
IE : OleVariant;
begin
IE := CoInternetExplorer.Create;
IE.Visible := True;
IE.Navigate2('http://www.3464.com');
end;