Вывести все файлы директории

Советы » Каталоги » Вывести все файлы директории

procedure

ListFileDir(Path: string

; FileList: TStrings); var

SR: TSearchRec; begin

if

FindFirst(Path + '*.*', faAnyFile, SR) = 0 then

begin

repeat

if

(SR.Attr <> faDirectory) then

begin

FileList.Add(SR.Name); end

; until

FindNext(SR) <> 0; FindClose(SR); end

; end

; procedure

TForm1.Button1Click(Sender: TObject); begin

ListFileDir('C:WINDOWS', ListBox1.Items); end

;

Другое по теме:

Категории

Статьи

Советы

Copyright © 2023 - All Rights Reserved - www.delphirus.com