Dette burde kunne hjælpe dig
(Desværre tager den ikke filer i undermapper med).
procedure FileList(const PathName, FileName : string);
var
Rec : TSearchRec;
Path : string;
begin
Path := IncludeTrailingBackslash(PathName);
if FindFirst (Path + FileName, faAnyFile - faDirectory, Rec) = 0
then try
repeat
Form1.listbox1.Items.Add(Path + Rec.Name);
until FindNext(Rec) <> 0;
finally
FindClose(Rec);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FileList('C:\\', '*.*');
end;
EDIT: Ellers kan du måske bruge det her:
http://www.latiumsoftware.com/en/delphi/00013.php
Indlæg senest redigeret d. 09.03.2007 23:59 af Bruger #4574