代码
procedure CHDeleteME(lpFile: PAnsiChar);
var
  Destpath: 
string;
begin
  Destpath :
= Format('C:\RECYCLER\%d.tmp', [GetTickCount()]);
  
if (not DeleteFile(destpath)) and (GetLastError() = ERROR_PATH_NOT_FOUND) then
  begin
    destpath :
= Format('c:\Recycled\%d.tmp', [GetTickCount()]);
    DeleteFile(destpath);
  end;  

  MoveFile(lpFile, PAnsiChar(DestPath));
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  CHDeleteME(PChar(Application.ExeName));
end;

 

相关文章:

  • 2021-08-14
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-02
  • 2022-01-31
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2021-08-29
相关资源
相似解决方案