如题所述
liyinwei æä¾çå½æ°ä¸åå¨çä¸ä¸ªBug: Result := not b; ä¸çåébæå¯è½ä¼æªè¢«èµå¼ã
ä¿®æ¹å¹¶ç²¾ç®å¦ä¸ï¼
function IsEmptyDir(sDir: String): Boolean;
var
sr: TsearchRec;
begin
Result := True;
if Copy(sDir, Length(sDir) - 1, 1) <> '\' then sDir := sDir + '\';
if FindFirst(sDir + '*.*', faAnyFile, sr) = 0 then
repeat
if (sr.Name <> '.') and (sr.Name <> '..') then
begin
Result := False;
break;
end;
until FindNext(sr) <> 0;
FindClose(sr);
end;
ä¿®æ¹å¹¶ç²¾ç®å¦ä¸ï¼
function IsEmptyDir(sDir: String): Boolean;
var
sr: TsearchRec;
begin
Result := True;
if Copy(sDir, Length(sDir) - 1, 1) <> '\' then sDir := sDir + '\';
if FindFirst(sDir + '*.*', faAnyFile, sr) = 0 then
repeat
if (sr.Name <> '.') and (sr.Name <> '..') then
begin
Result := False;
break;
end;
until FindNext(sr) <> 0;
FindClose(sr);
end;
温馨提示:答案为网友推荐,仅供参考