You can do this by adding a link to system.IO and using this code: (DDLFolder is a drop-down list, and if you are writing an ASP.Net application to get the path, use Server.Mappath ("~ / yourpath"))
DirectoryInfo df = new DirectoryInfo(userFolderPath); DDLFolder.Items.Clear(); DDLFolder.Items.Add("Root"); foreach (DirectoryInfo d in df.GetDirectories()) { DDLFolder.Items.Add(d.Name); }
source share