procedure TForm1.Button1Click(Sender: TObject);
Var
Found: integer;
SearchRec: TSearchRec;
FileName: string;
begin
Found := FindFirst('c:/*.*',faAnyFile,SearchRec);
while Found = 0 do
begin
Filename:=SearchRec.Name;
if SearchRec.Attr=faDirectory then FileName := FileName + '/';
ListBox1.Items.Add(FileName);
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);
end;