C++Builder按钮网址链接
代码如下://---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShellExecute(Handle,NULL,"http://www.52pojie.cn/",NULL,NULL,SW_SHOWNORMAL);
}
//---------------------------------------------------------------------------
在C++Builder 6.0编译通过。
关键是这句话,ShellExecute(Handle,NULL,"http://",NULL,NULL,SW_SHOWNORMAL);
把http://替换成你想要的网址就可以了。
页:
[1]