public class NameTest
{
public static void Main()
{
// Create a reference to the current directory.
DirectoryInfo di = new DirectoryInfo(@"E:\");
// 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);
Console.ReadLine();
}
}