Answers for "c# getDirectories get directory name"

C#
1

get folders in directory c#

string[] folders = System.IO.Directory.GetDirectories(@"C:My Sample Path","*", System.IO.SearchOption.AllDirectories);
Posted by: Guest on October-30-2020
0

get directory name of path c#

string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;
Posted by: Guest on January-01-2021

C# Answers by Framework

Browse Popular Code Answers by Language