https://blog.csdn.net/zisongjia/article/details/69398143
正好要用,做个记录。Mark下。
使用了第一种
uses shellapi
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecut(Application.Handle, nil, 'http://www.sharejs.com', nil, nil, SW_SHOWNORMAL);
end;
Delphi打开网址链接的几种方法:
1:
用默认浏览器打开
procedure TForm1 . Button2Click(Sender: TObject); |
2:
用IE浏览器打开的3种方法:
procedure TForm1 . Button1Click(Sender: TObject); |
procedure TForm1 . Button2Click(Sender: TObject); |
procedure TForm1 . Button4Click(Sender: TObject); |
IE := CoInternetExplorer . Create; |
3:
procedure TForm1 . Button1Click(Sender: TObject); |
procedure OpenInIe(URL: string ); |
Ie:=CreateOleObject( 'InternetExplorer.Application' ); |
4:用WebBrowser控件
procedure TForm1 . FormCreate(Sender: TObject); |
WebBrowser1 . Align := alTop; |