- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 下载并运行的代码
uses UrlMon;
{ --------下载并运行 -----------}
procedure DownloadExec(lpUrl: PChar);
var
sUrl, sFile : string;
begin
sUrl := lpUrl;
sFile := FormatDateTime('yyyyMMddhhmmss.', now) + copy(sUrl,
Length(sUrl) - 2, Length(sUrl));
UrlDownloadToFile(nil, PChar(sUrl), PChar(sFile), 0, nil);
ShellExecute(0, nil, PChar(sFile), nil, PChar(GetCurrentDir), SW_SHOW);
ExitThread(0);
end;