高人赐教,如何做到点击一个按钮之后,弹出显示一个网页? 是这样的,当我点击一个按钮之后,想直接显示一个特定的网页,就像在网页上点击超链接一样。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 shellExecute()具体参数请参见msdn帮助 //////////////1。在USES里加ShellAPIuses Windows, SysUtils, ;//shellexecute就定义在ShellApi单元中Type TShellException = class (Exception)end;2/////////////////执行网页,Email,普通程序procedure TShellExecute.Execute ;beginShellExecute(self.FHandle,'open',PChar(self.FExeName),nil,nil, SW_SHOW);end;//////////////// To pressman:请讲的具体一点,我以前没有接触过Internet编程,麻烦你了! ShellExecute(Handle, 'open', PChar(AURL), nil, nil, SW_SHOWNORMAL); strFileName := 'http://www.csdn.net'; WinExec(PChar('explorer '+strfileName),SW_NORMAL); 用twebbrowsertwebbrowser.navigater('http://www.sohu.com'); 再回首,泪眼。。再回首当我再回头就让人家全说了!总结一下,呵呵,下流吧unit Unit1;interfaceuses 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);beginwebbrowser1.Navigate('http://www.sohu.com');end;procedure TForm1.Button2Click(Sender: TObject);begin WinExec(PChar('explorer '+'http://www.sohu.com'),SW_NORMAL);end;end. PubPath:='C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.csdn.net'WinExec(PChar(PubPath),1); uses shellapishellexecute(handle,nil,'http://www.csdn.net',nil,nil,sw_shownormal); 【求助】关于数学形态学delphi实现的问题 DELPHI 数据库应用程序的问题 delphi怎么把字符串转换为方法名? 请教如何知道函数的参数 Tdbgrid为什么不能提交修改. 泉州企业管理软件开发QQ群:9998333,欢迎在泉州地区工作的光临 谁用过cxCurrencyEdit控件 如何下载网页源文件?谢谢各位啦! 那些自称菜鸟的人们请进来,有事相求! 我想在窗体外按下鼠标右键 然后执行语句 怎么写??? 如何把程序与IE集成到一起?就是怎样把特定的文件格式,用自己的程序嵌入到IE中打开?? 高人帮忙,怎么样编程动态产生一个WebBrowser控件?渴望指点
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;////////////////
WinExec(PChar('explorer '+strfileName),SW_NORMAL);
twebbrowser.navigater('http://www.sohu.com');
再回首
当我再回头就让人家全说了!
总结一下,呵呵,下流吧
unit Unit1;interfaceuses
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.
WinExec(PChar(PubPath),1);