I have a list of directories in a parent directory. These directories will be created in a format like 00001, 00002, 00003... so that the one with the bigger trailing number is the recent one. in the above instance, it is 00003. I want to get this programmatically.
thanks for any help..
Try this:
var first = Directory.GetDirectories(@"C:\")
.OrderByDescending(x => x).FirstOrDefault();
Obviously replace C:\
with the path of the parent directory.