Get the files from the root directory in CSharp
Description
The following code shows how to get the files from the root directory.
Example
/*from w w w .j av a 2 s. co m*/
using System;
using System.IO;
class MainClass
{
public static void Main()
{
string[] aFiles = Directory.GetFiles("c:\\");
foreach (string s in aFiles)
Console.WriteLine(s);
}
}
The code above generates the following result.