Add System.IOUtils
to your offer. Then you can use the TPath
and TDirectory
something like this:
uses System.IOUtils, System.Types; procedure TForm1.Button1Click(Sender: TObject); var FileList: TStringDynArray; DocDir: string; s: string; begin Memo1.Lines.Clear; DocDir := TPath.GetDocumentsPath; FileList := TDirectory.GetFiles(DocDir); for s in FileList do Memo1.Lines.Add(s); end;
source share