Autor Beitrag
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mo 08.08.05 15:41 
Hallo Leute,

folgendes ich bekomme einen Pfad von einem User, zB.:

C:\Test\001\

Jetzt befinden sich unter dem Ordner immer mehrere Ordner auf gleicher Ebene.

Also so gesehen:

C:\Test\001\123
C:\Test\001\124
C:\Test\001\125
usw.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
  SearchResult: TSearchRec;
  lCounter: integer;
begin
  lCounter := 0;
  if FindFirst (IncludeTrailingBackslash ('C:\Test\001\123')
    + '*.jpg', faAnyFile, SearchResult) = 0 then begin
  repeat
    Images.Add (IncludeTrailingBackslash ('C:\Test\001\123') + SearchResult.name);
  until FindNext(searchResult) <> 0;
  FindClose(searchResult);
  for lCounter := 0 to Images.Count-1 do
    Image1.Picture.LoadFromFile (Images [lCounter]);
  end;
end;


Mit diesem Code kriege ich die Bilder heraus wenn ich direkt auf diese Unterordner zeige... nicht aber wenn ich nur auf C:\Test\001\ zeige.

Wie kriege ich denn alle Bilder unter C:\Test\001\ raus?

Danke für die Hilfe!
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 08.08.05 16:16 

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Mo 08.08.05 16:18 
Hi,
Du packst dein Code in eine Schleife und statt '123' machst du ne Variable die sich bei jedem Durchlauf um 1 erhöht.
Davor kannst du noch prüfen ob das Verzeichnis existiert (IF DIREXISTS ... glaub ich)

Viel glück...
Alpha_Wolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Do 11.08.05 07:10 
Danke Stefan H (wir sind übrigens Namenskollegen(sogar der Anfangsbuchstabe deines Nachnamens stimmt mit meinem überein... 8) ))

Die Link war echt hilfreich!

Hab zwar wieder mal n ähnliches Problem aber ich werd mir mal das ganze genau anschauen wenn ich wieder etwas mehr Zeit habe.