Einzelnen Beitrag anzeigen

Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#4

Re: Festplatte durchsuchen lassen???

  Alt 23. Mär 2005, 10:17
Scroll im oben verlinken Thread mal runter. Da findest Du den (meinen) Code, den alcaeus gemeint hat, auch.

Guckst Du:
Delphi-Quellcode:
procedure FileList(const APath, AExt: string; ARecurse: Boolean;
  AList: TStrings);
var
  F : TSearchRec;
  Path : string;
begin
  Path := IncludeTrailingPathDelimiter(APath); // nur für Delphi 4 und höher!
  if (ARecurse) and
    (FindFirst(Path + '*.*', faAnyFile, F) = 0) then
  try
    repeat
      if (F.Name <> '.') and (F.Name <> '..') and
        ((F.Attr and faDirectory) = faDirectory) then
        FileList(Path + F.Name, AExt, ARecurse, AList);
    until FindNext(F) <> 0;
  finally
    FindClose(F);
  end;
  if FindFirst(Path + AExt, faAnyFile, F) = 0 then
  try
    repeat
      if (F.Name <> '.') and (F.Name <> '..') and
        ((F.Attr and faDirectory) <> faDirectory) then
        AList.Add(Path + F.Name);
    until FindNext(F) <> 0;
  finally
    FindClose(F);
  end;
mfG
mirage228
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat