Mach bitte _nicht_ nur Copy&Paste!!!
Delphi-Quellcode:
procedure ListeDir(Path: string; FileList: TStrings);
var
SR: TSearchRec;
begin
if FindFirst(Path + '*.*', faAnyFile, sr) = 0 then
begin
repeat
if ((sr.Attr and faDirectory) = faDirectory) and
(sr.Name <> '.') and
(sr.Name <> '..') then
begin
FileList.Add(sr.Name);
end;
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ListeDir('C:\Windows\', ListBox1.Items);
end;
ungetestet