刪除目錄及目錄下的文件(user ShellApi單元)
function SHMyDelDirectory(const Source: string): boolean;
var fo: TSHFILEOPSTRUCT;
begin
FillChar(fo, SizeOf(fo), 0);
with fo do
begin
Wnd:= 0;
wFunc := FO_Delete;
pFrom := PChar(Source + #0);
pTo := #0#0;
fFlags := FOF_NOCONFIRMATION + FOF_SILENT;
end;
Result := (SHFileOperation(fo) = 0);
end;
Delphi中關於文件、目錄操作的函數