很简单啊!
var
a:string;
b:string;
c:string;
begin
Edit1.Text := '';
a:= 'http://www.baidu.com';
b:=Edit1.Text;
c:= a + b;
ShellExecute(Handle,'open','Explorer.exe',PChar(c),nil,SW_SHOWNORMAL);//需要引用ShellAPI
end;
已经在Delphi上测试过了,OK!
a的赋值语句后面没分号;
ShellExecute的第四个参数要转换成PChar
ShellExecute(Handle,'open','Explorer.exe',PChar(c),nil,SW_SHOWNORMAL);
a:= 'http://www.baidu.com' 后边有个分号 ;
再有就是从网上复制下来的代码,是否有特别字符呢?
有些空格的地方其实就是特殊字符。