Articles → CSHARP → Get The List Of All Folders On A Given Path Using C#
Get The List Of All Folders On A Given Path Using C#
Path
Click to Enlarge
Code
using System;
using System.IO;
namespace TestApp {
class Program {
static void Main(string[] args) {
DirectoryInfo di = new DirectoryInfo(@ "complete_path");
foreach(DirectoryInfo d in di.GetDirectories()) {
Console.WriteLine(d.Name);
}
Console.Read();
}
}
}
Output
Click to Enlarge