Reputation: 3761
I am wondering how I can get the file path, 1 level above the folder passed into a string.
So I have the following code:
foreach (DirectoryInfo directory in rootDir.GetDirectories())
{
string test = directory.FullName;
}
This returns the directory name including the folder name so it is returning this:
c:\test\FolderName
Where FolderName is the name of the directory object.
How would I get only c:\test?
Upvotes: 0
Views: 160