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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.