Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Can't gaurentee this works correctly since i am not
- * near my compiler and am writing it freehand in Pastebin
- * but in theory it should work.
- */
- int countDirectories(string Dir)
- {
- int retVal = 0;
- string[] Names = Dir.Split('\');
- //If you want to include the root ( ex. f:\ )
- return Names.Count;
- //If you don't want to include the root
- return Names.Count - 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement