Question Counting Parent Directories in the DirectoryInfo Class

jsm87

New member
Joined
Oct 29, 2008
Messages
2
Programming Experience
1-3
Does anyone know if it's possible to iterate through every parent of a specified subdirectory until you reach the directory's root so that I can count the number of parents? I'm new to System.IO, but I have'nt seen any included counting functions.
 
You would use the IO.Path class and its GetDirectoryName method. You give it a folder path and it will give you the parent folder path. You keep doing that until you get to the root.
 

Latest posts

Back
Top