Autor Beitrag
Aretures
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

XP
Delphi 7 Arch. | Delphi 2005 Arch.| Delphi 3 Prof.
BeitragVerfasst: Mo 09.05.05 19:57 
Hoi^^

Ich habe vollgenden Frage: Wie stelle ich fest wie viel Ordner in einem Verzeichniss sind und wie jeder dieser Ordner heißt ?
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 09.05.05 20:07 
Hallo!

Suche in: Delphi-Forum, Delphi-Library FINDFIRST und Suche in: Delphi-Forum, Delphi-Library FINDNEXT sind Deine Freunde!

Grüße
Christian

P.S.: "Verzeichnis" schreibt man mit einem "s" am Ende ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 09.05.05 20:26 
@TUFKAPL: Er meint doch mehrere ;-)

Aber nunja ... am Ende Suche in: Delphi-Forum, Delphi-Library FINDCLOSE nicht vergessen ^^

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Mo 09.05.05 21:01 
Vieleicht hilft dir das ein bisschen weiter.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm2.AlleUnterordnerladen1Click(Sender: TObject);
 var SR : TSearchRec;
str,ADirectory:String;

begin
str := Form1.ShellTreeView1.SelectedFolder.PathName;
ADirectory:=Form1.ShellTreeView1.SelectedFolder.PathName+'\';
if (FindFirst(ADirectory+'*.*',faDirectory,SR)=0) then
  begin
    repeat
      if (SR.Name<>'.') and (SR.Name<>'..') and (faDirectory and Sr.Attr = fadirectory ) then
      begin
        ListBox1.Items.Add(sr.Name);
        RichEdit1.Lines:=(ListBox1.Items);

      end;
    until FindNext(SR)<>0;
    FindClose(SR);
   Caption:='  In Ordner '+ (ExtractFileName(str )+ ExtractFileExt(str))+' befinden sich '+inttostr(Listbox1.Items.count)+' Unterordner !';
   end;
 end;