Advertisement
VoronVU

Получение Списка Файлов в Директории

Nov 6th, 2014
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.42 KB | None | 0 0
  1. //Выводит имена файлов в TMemo
  2. uses
  3.   System.SysUtils;
  4.  
  5. procedure TForm1.Button1Click(Sender: TObject);
  6. var
  7.   Sr : TSearchRec;
  8.   Attr : Integer;
  9.   flPath : String = '';
  10. begin
  11.   Attr := faAnyFile - faVolumeID - faDirectory;
  12.   try
  13.     if FindFirst(flPath + '*', Attr, Sr) = 0 then
  14.     repeat
  15.       Memo1.Lines.Add(Sr.Name);
  16.     until FindNext(Sr) <> 0;
  17.   finally
  18.     FindClose(Sr);
  19.   end;
  20. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement