Autor Beitrag
cromos
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Do 28.08.03 13:13 
Hallo,

ich habe eine Listbox,

in der möchte ich alle Unterordner angezeigt bekommen, die sich in
einem bestimmten Ordner befinden.

Gibt es sowas wie FindFirst/FindNext auf für Ordner?

Gruss
Cromos
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Do 28.08.03 13:29 
Titel: Schon gefunden
Hab schon das richtige gefunden:

[url]
www.tipps.delphi-sou...20020329.shtml[/url]
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 28.08.03 13:31 
Hi.

So sollte es gehen:

Dir muss dabei mit dem letzen "\" angegeben werden!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure getDirsFromDir (dir : String; liste : TStrings);
VAR datei : TSearchRec;
    fehler : Integer;
begin
  fehler:=FindFirst(dir+'*.*',faDirectory,datei);
  while fehler = 0 do
  begin
    if datei.Attr and faDirectory <> 0 then
      liste.Add(datei.name);
    fehler:=FindNext(datei);
  end;
  FindClose(datei);
end;


MfG
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 28.08.03 13:40 
Hallo!

Noch mehr Beispiele findest du wenn du hier im Forum nach Suche in: Delphi-Forum, Delphi-Library FINDFIRST FINDNEXT suchst.

Gruß
Tino