Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

How do I get fullname of parent Directory in ASP.NET 2.0 / C#?

I'm trying to get the full path of the parent directory using Sytem.IO's built in .Parent function, but they only return the name of the parent directory, not the full name. So I get this:

FullName                   Name            Parent
----------------------------------------------------
C:\Temp\First             First             Temp
C:\Temp\Second       Second        Temp
C:\Temp\Third            Third            Temp

I really want to make the parent field C:\Temp. So I was thinking to remove the name from the fullname, then prefix to the parent name. What's the best way to do this?
ASKER CERTIFIED SOLUTION
Avatar of drichards
drichards

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bemara57
bemara57

ASKER

I didn't know Parent.FullName existed.. that's exactly what I needed. Thanks!