Und falls du Klassen des .NET Frameworks nutzen möchtest schaut das ungefähr so aus (Aus der .NET Framework Hilfe)
Code:
using System;
using System.IO;
public class NameTest
{
public static void Main()
{
// Create a reference to the current directory.
DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory);
// Create an array representing the files in the current directory.
FileInfo[] fi = di.GetFiles();
Console.WriteLine("The following files exist in the current directory:");
// Print out the names of the files in the current directory.
foreach (FileInfo fiTemp in fi)
Console.WriteLine(fiTemp.Name);
}
}
Musst du halt noch entsprechend in Delphi-Syntax bringen