Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

reading directories.

i hope someone can help.

being new to vb.net i was wondering if someone can give me any pointers in how i can do something that i need.

i have a directory structure that i need my program to read, and in one particular folder within each folder i need it to choose the folder with the highest number and then feed that info back.
ie root folder has lots of folders 100+ and in each of those folders is 1 or more folders named 1.0.0 or higher (1.0.1, 1.0.2 etc). what i need it to do is read the folders and if there is more than one folder, to then pick the one with the biggest number.

can it be done?
[634 byte] By [twazok] at [2007-11-11 7:20:22]
# 1 Re: reading directories.
' Return subdirectories of c:\temp as string array
Dim Dirs() As String = System.IO.Directory.GetDirectories("c:\temp")
' Sort array
Array.Sort(Dirs)
' Print highest number (last element of array)
Debug.WriteLine(Dirs(Dirs.Length - 1))
Phil Weber at 2007-11-11 17:27:05 >