本文整理自网络,侵删。
procedure DeleteFileEx(FileName:string);
var
FileDir:string;
FileStruct:TSHFileOpStruct;
begin
FileDir := FileName;// 'C:\temp\abc*.txt';
FileStruct.Wnd :=0;
FileStruct.wFunc :=FO_delete;
FileStruct.pFrom:=Pchar(FileDir+#0);
FileStruct.fFlags:=FOF_NOCONFIRMATION;
FileStruct.pTo := ' ';
// if SHFileOperation(FileStruct)=0 then
// showmessage( 'The Files Has Been Deleted! ');
end;
相关阅读 >>
Delphi strutils.leftstr、strutils.rightstr - 提取左右字符串
更多相关阅读请进入《Delphi》频道 >>