本文整理自网络,侵删。
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;
相关阅读 >>
Delphi webbrowser的关于流载入流保存和流生成
更多相关阅读请进入《Delphi》频道 >>