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;

相关阅读 >>

Delphi datasnap双缓存下载文件

Delphi 逐个分解后字符串加载到stringgrid1

Delphi twebbrowser 屏蔽右键菜单

Delphi打开文件夹并定位到一个文件

Delphi获取ie浏览器url地址

Delphi中用socket解析域名获得ip地址

Delphi切换指定窗口到最前并获得焦点

Delphi 控制台读写

Delphi中indy10 的idtcpserver断开客户端连接报错问题的解决办法

Delphi 去掉twebbrowser的滚动条

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...