11.12.2005, 09:29
общий
это ответ
Здравствуйте, Dimon007!
При помощи FindFirst/FindNext. Пример см. в приложении.
Приложение:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}const path=‘C:\‘;procedure TForm1.FormCreate(Sender: TObject);var f:tsearchrec;begin findfirst(path+‘\*‘,faAnyFile,f); findnext(f); while (findnext(f)=0) do if (f.attr and fadirectory)<>0 then ListBox1.Items.Add(f.name); findclose(f);end;end.