scm0sml
asked on
Getting the last directory from a directory path
I'm using a folder browser to get a path to a directory that I will be compressing.
For eg C:\\Program File\Visual Studio.
As well as this I want to read the last directory of the path into a string...so in this case Visual Studio as this will be the name of the compressed file.
The code I have to get the path is:
//set source path of snapshot
snapshotSource = _snapshotFolderBrowser.Sel ectedPath;
//now I need the code for
string compressedFileName = ???
Can someone give me some pointers to go about this please....
Cheers
For eg C:\\Program File\Visual Studio.
As well as this I want to read the last directory of the path into a string...so in this case Visual Studio as this will be the name of the compressed file.
The code I have to get the path is:
//set source path of snapshot
snapshotSource = _snapshotFolderBrowser.Sel
//now I need the code for
string compressedFileName = ???
Can someone give me some pointers to go about this please....
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yep working...
cheers for that!
cheers for that!
System.IO.DirectoryInfo pDirInfo = new System.IO.DirectoryInfo("p
System.IO.DirectoryInfo lastDirInfo =
(pDirInfo.GetDirectories()
Alex :p