Zitat von
Wuaegner:
GetFilesInDirectory
hast du selber geschrieben oder? Wie sieht die aus?
So:
Delphi-Quellcode:
procedure GetFilesInDirectory(Directory: String; const Mask: String;
List: TStrings;
WithSubDirs, ClearList: Boolean);
procedure ScanDir(const Directory: String);
var
SR: TSearchRec;
begin
if FindFirst(Directory + Mask, faAnyFile - faDirectory, SR) = 0 then try
repeat
List.Add(Directory + SR.Name)
until FindNext(SR) <> 0;
finally
FindClose(SR);
end;
if WithSubDirs then begin
if FindFirst(Directory + '*.*', faAnyFile, SR) = 0 then try
repeat
if (SR.Attr = faDirectory) and
(SR.Name <> '.') and (SR.Name <> '..') then
ScanDir(Directory + SR.Name + '\');
until FindNext(SR) <> 0;
finally
FindClose(SR);
end;
end;
end;
begin
List.BeginUpdate;
try
if ClearList then
List.Clear;
if Directory = '' then Exit;
if Directory[Length(Directory)] <> '\' then
Directory := Directory + '\';
ScanDir(Directory);
finally
List.EndUpdate;
end;
end;
Zu finden auf
www.dsdt.info (im EDH)