procedure TFormList.RecurseDir(PathInicial: string); var SearchRec: TSearchRec; Result: integer; tmpName: string; begin DirectoryListBox1.Directory:=PathInicial; Result:=FindFirst(PathInicial+'\*.*', faAnyFile, SearchRec); While Result = 0 do begin if ExtOk(SearchRec.Name) then { если каталог... } if SearchRec.Attr and faDirectory > 0 then { рекурсивно обрабатываем... } RecurseDir(PathInicial+'\'+SearchRec.Name) else begin tmpName:=PathInicial+'\'+SearchRec.Name; tmpName:=Copy(tmpName, Pos(PathOrigen,tmpName)+Length(PathOrigen), Length(tmpName)-Length(PathOrigen)); ListBox1.Items.Add(LowerCase(tmpName)); end; Application.ProcessMessages; Result:=FindNext(SearchRec); end; DirectoryListBox1.Directory:=PathInicial; end; |
[001693]