高人赐教,如何做到点击一个按钮之后,弹出显示一个网页?
是这样的,当我点击一个按钮之后,想直接显示一个特定的网页,就像在网页上点击超链接一样。 问题点数:20、回复次数:10Top
1 楼liangjinliang()回复于 2004-12-02 13:11:10 得分 5
shellExecute()具体参数请参见msdn帮助Top
2 楼pressman(大苯熊)回复于 2004-12-02 13:25:58 得分 0
//////////////
1。在USES里加ShellAPI
uses
Windows, SysUtils, ;//shellexecute就定义在ShellApi单元中
Type
TShellException = class (Exception)
end;
2///////////////
//执行网页,Email,普通程序
procedure TShellExecute.Execute ;
begin
ShellExecute(self.FHandle,'open',PChar(self.FExeName),nil,nil, SW_SHOW);
end;
////////////////Top
3 楼zhengdao()回复于 2004-12-02 13:41:39 得分 0
To pressman:请讲的具体一点,我以前没有接触过Internet编程,麻烦你了!Top
4 楼swayi21(微斯人)回复于 2004-12-02 13:47:52 得分 5
ShellExecute(Handle, 'open', PChar(AURL), nil, nil, SW_SHOWNORMAL);Top
5 楼fbysss(独孤求败)回复于 2004-12-02 13:48:18 得分 0
strFileName := 'http://www.csdn.net';
WinExec(PChar('explorer '+strfileName),SW_NORMAL);Top
6 楼lzy6204(为了忘却的记忆)回复于 2004-12-02 13:50:16 得分 5
用twebbrowser
twebbrowser.navigater('http://www.sohu.com');Top
7 楼pressman(大苯熊)回复于 2004-12-02 14:08:18 得分 5
再回首,泪眼。。
再回首。。。
当我再回头就让人家全说了!
总结一下,呵呵,下流吧
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls, OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
Button1: TButton;
WebBrowser1: TWebBrowser;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
webbrowser1.Navigate('http://www.sohu.com');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
WinExec(PChar('explorer '+'http://www.sohu.com'),SW_NORMAL);
end;
end.
Top
8 楼lovelwx(农民的儿子)回复于 2004-12-02 14:19:18 得分 0
PubPath:='C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.csdn.net'
WinExec(PChar(PubPath),1);Top
9 楼shunbing()回复于 2004-12-02 16:19:52 得分 0
uses shellapi
shellexecute(handle,nil,'http://www.csdn.net',nil,nil,sw_shownormal);Top
10 楼zhengdao()回复于 2004-12-06 12:26:27 得分 0
问题已解决,谢谢各位了!Top




