I have following code that reads folder names given a path.
string[] dirNames =(Directory.GetDirectories(@"c:\test\project\"));
foreach(string name in dirNames)
{
Console.WriteLine(name);
}
Problem is that dirNames array is storing the directory name with path. While I just want to store the directory file name no path. I can remove it in the foreach loop but I want to store originally in the array with out path. Please let me know how to fix it. Thanks