AW: Dateinamen speichern
8. Nov 2012, 14:25
Delphi-Quellcode:
//Liefert Datei-Liste ohne Unterordner
procedure GetFiles(Path, ExtMask: String; List: TStrings);
const
Attrib = faArchive or faReadOnly or faHidden;
var
SR: TSearchRec;
begin
Path := IncludeTrailingBackslash(Path);
if FindFirst(Path + '*.' + ExtMask, Attrib, SR) = 0 then
repeat
List.Add(Path + SR.Name);
until FindNext(SR) <> 0;
SysUtils.FindClose(SR);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
GetFiles('c:\', 'txt', ListBox1.Items);
end;
Geändert von Popov ( 8. Nov 2012 um 14:34 Uhr)
|