给你一个可以计时到时还可以把自己给删除掉的源代码
我本人试验过通过的 呵呵 8-)
完全可以达到如上所说的一点!
记住我 你们的最要好的朋友 Eroswar
DFW昵称:qbtxx
源代码如下:
unit SanCu;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,registry, StdCtrls;
type
TForm1 = class(TForm)
{ Private declarations }
procedure FormDestroy(Sender: TObject);
public
qbt:TRegistry;
{ Public declarations }
end;
var
Form1: TForm1;
jqk:integer;
AQQ:string;
f:textfile;
implementation
{$R *.dfm}
procedure TForm1.FormDestroy(Sender: TObject);
begin
qbt:=TRegistry.Create;
qbt.RootKey:=HKEY_CURRENT_USER;
qbt.OpenKey('Software',false);
qbt.CreateKey('QQ');
qbt.OpenKey('QQ',true);
begin if qbt.ValueExists('AQQ')then begin
jqk:=qbt.ReadInteger('AQQ');
if (jqk<>0)and(jqk<>6)then begin
jqk:=jqk+1;
qbt.WriteInteger('AQQ',jqk);
qbt.CloseKey;
qbt.Free;
end;
if jqk=6 then
begin
AssignFile(F, 'delself.bat');
Rewrite(F);{F为TextFile类型}
writeln(f,'@echo off');
writeln(f,'loop');
WriteLn(F,'del '+ExtractFileName(Application.ExeName));
writeln(f,'if exist'+Application.ExeName+'Goto loop');
writeln(f,'del delself.bat');
CloseFile(F);
WinExec('delself.bat',SW_HIDE);
close;
end;
end else qbt.WriteInteger('AQQ',1);
end;
end;
end.
给点奖励分吧!