with this code
string[] directories = Directory.GetDirectories(path);
I am able to get the directories in that path but I get the full path, e.g.:
C:\Users\test1\Documents\Visual Studio 2010
C:\Users\test1\Documents\test
C:\Users\test1\Documents\example
How can I get the name of the last directory!?
Call
Path.GetFileName()to get the last segment of a path.