Get the directories
Here is the code how to get all directories and save them to a List:
//Path with all directories in
String Path = Server.MapPath("Folder1\\"); //Declare ListList<String> GetThreads = new List<String>();
//Get all direcotoriesSystem.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(Path);
foreach (System.IO.DirectoryInfo file in dir.GetDirectories())
{
//This saves all Direcory names like "Folder1", "Folder2", "Folder3", "Folder4";
GetThreads.Add(file.Name);
}
0 comments:
Post a Comment
Thanks for the Comments.