function ReturnFiles(slFilePath: string):TStringList; var Sr : TSearchRec; Err : integer; begin result:=TStringList.Create; if slFilePath='' then exit; if RightStr(slFilePath,1)<>'' then slFilePath:=slFilePath+''; Err:=FindFirst(slFilePath+'*', faAnyFile, Sr) ; While (Err = 0) do begin if (sr.Name[1]<>'.')and ((Sr.Attr and faDirectory) = 0) then Result.Add(Sr.Name); if ((Sr.Attr and faDirectory) <> 0) AND (Sr.Name[1] <> '.') then begin ReturnFiles(slFilePath+ sr.Name); end; Err:=FindNext(Sr) ; end ; FindClose(Sr); end;