Einzelnen Beitrag anzeigen

Furtbichler
(Gast)

n/a Beiträge
 
#5

AW: Search for multiple files at once in PC

  Alt 1. Jan 2013, 15:40
Thank you, can you please give some code.
Why should I?

Ok, It's new year.

Delphi-Quellcode:
Procedure FindFiles (path : String; Files : TStrings; FoundFiles : TSTrings);
Var
  S : TSearchRec;

Begin
  if FindFirst(path+'\*.*',faAnyFile,S)=0 then begin
    repeat
      if S.Attr and faDirectory<>0 then
        FindFiles(path+'\'+s.Name,Files,FoundFiles)
      else if MatchesAny(S.Name, Files) then
        FoundFiles.Add(path+'\'+S.Name);
    until FindNext(S)<>0;
    FindClose(S);
  end;

    if FindFirst(path+'\*',faDirectory ,S)=0 then begin
    repeat
      if (s.Name<>'.') and (s.Name<>'..') Then
        FindFiles(path+'\'+s.Name,Files,FoundFiles)
    until FindNext(S)<>0;
    FindClose(S);
  end;
End;
The function 'MatchesAny' tries to match a filename with a list of given files (including wildcards). Maybe you can code this yourself.
  Mit Zitat antworten Zitat