How To Get List Of Folders in Asp.Net?

 Posted by Vishalneeraj-24503 on 3/1/2015 | Category: ASP.NET Interview questions | Views: 891 | Points: 40
Answer:

To get a list of all sub directories from one location,we can use GetDirectories method.

string[] Directories = 

System.IO.Directory.GetDirectories(Server.MapPath("~/"));


Server.MapPath("~/") will simply return root folder of web application.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response