怎样用delphi删除非空文件夹?
答案:1 悬赏:70 手机版
解决时间 2021-04-05 23:44
- 提问者网友:别再叽里呱啦
- 2021-04-05 05:45
怎样用delphi删除非空文件夹?
最佳答案
- 五星知识达人网友:低血压的长颈鹿
- 2021-04-05 06:08
uses
..., ShellApi,..;
function TForm1.DelDirectory(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;
..., ShellApi,..;
function TForm1.DelDirectory(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;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯