当前位置: 代码迷 >> 综合 >> delphi 删除文件夹
  详细解决方案

delphi 删除文件夹

热度:45   发布时间:2024-02-10 10:35:12.0
直接在uses shellapi之后,调用SHMyDelDirectory去删除你的目录bai.
function SHMyDelDirectory(const Source: string): boolean;
var
fo: TSHFILEOPSTRUCT;
beginFillChar(fo, SizeOf(fo), 0);with fo dobeginWnd := 0;wFunc := FO_Delete;pFrom := PChar(Source + #0);pTo := #0#0;fFlags := FOF_NOCONFIRMATION + FOF_SILENT;end;
Result := (SHFileOperation(fo) = 0);
end;

 

  相关解决方案