几种程序自杀的方法
procedure DeleteMe;'bmx }yvar
BatchFile: TextFile;3N(uw l$rB`C
BatchFileName: string;
ProcessInf TProcessInformation;!~2U:IDV
StartUpInf TStartupInfo;7S2tHR7^#I}&A
begin
BatchFileName := ExtractFilePath(ParamStr(0)) + '_deleteme.bat'; Z0R8R%F8k7l
AssignFile(BatchFile, BatchFileName);r.\-z H n
Rewrite(BatchFile);|$janh/W,Ra
Writeln(BatchFile, ':try');
Writeln(BatchFile, 'del "' + ParamStr(0) + '"');K%f X9K Q qE
Writeln(BatchFile,
'if exist "' + ParamStr(0) + '"' + ' goto try');
Writeln(BatchFile, 'del %0');!@&?C^NE h tP
CloseFile(BatchFile); wc,l9[[[(_Z
@ f;V.s1O$@%V?
FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow := SW_HIDE;9r@5u^o4J5Wl
if CreateProcess(nil, PChar(BatchFileName), nil, nil,+]6rO)KK g,o
False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo,apg2_E
ProcessInfo) then
begin
CloseHandle(ProcessInfo.hThread);8uap+@8I0X9\
CloseHandle(ProcessInfo.hProcess);J2Nm#UWE%nD
end;7_[D{yb hZ
end;Q+|sh P%@"\t'p
procedure TForm1.Button1Click(Sender: TObject);