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;

相关阅读 >>

Delphi 回车 选择下一个控件

Delphi数组之菜鸟篇

Delphi 获取memo文本光标的位置

Delphi入门语法

Delphi xe 如何实现("再按一次退出") 然后退出程序

Delphi 删除只读文件

Delphi cxgrid:动态设计统计功能

Delphi android.os获取sn号

Delphi xe 的 tdictionary

Delphi tstream 详细介绍

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...