.net - How do I find greater number folder from root folder path using c#? -


i have 3 folders in controllers folder z1 , z2 , z3

how compare , find out z3 greater among listed folders?

this code give me folder depth .

public static int folderdepth(string path)     {         if (string.isnullorempty(path))             return 0;         directoryinfo parent = directory.getparent(path);         if (parent == null)             return 1;         return folderdepth(parent.fullname) + 1;     } 

enter image description here

greater means in name 3 greater 2 &1 z3 greater. out put should z3

var directory = directory.getdirectories(path)                          .orderbydescending(dir => dir)                          .firstordefault(); 

now, may have problem. supposed "greater", z15 or z2? , how computer find out? folders follow pattern?


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -