Registriert seit: 16. Nov 2005
51 Beiträge
Delphi 2005 Personal
|
Re: Listenindex überschreitet das Maximum (255)
27. Feb 2006, 01:05
Delphi-Quellcode:
procedure Tfrmprozesseinfuegen.datei1(Directory: string; Mask: String; ARekursiv: Boolean);
var
SR: TSearchRec;
begin
if (Directory<>'') and (Directory[length(Directory)]<>'\') then
Directory:=Directory+'\';
if (FindFirst(Directory+Mask,faAnyFile-faDirectory,SR)=0) then begin
repeat
if (SR.Name<>'.') and (SR.Name<>'..') and (SR.Attr<>faDirectory) then
begin
ListBox1.items.Add(Directory+SR.Name);
end;
until FindNext(SR)<>0;
FindClose(SR);
end;
if ARekursiv then
if (FindFirst(Directory+'*.*',faDirectory,SR)=0) then
begin
repeat
if (SR.Name<>'.') and (SR.Name<>'..') then
datei1(Directory+SR.Name,Mask,True);
until FindNext(SR)<>0;
FindClose(SR);
end;
end;
procedure Tfrmeinfuegen.ToolButton6Click(Sender: TObject);
begin
datei1('C:\', '*.mp3', true);
end;
Milan
|
|
Zitat
|