ASP.NET's file system processing is much more advanced then what was
available in classic ASP. Despite all the improvements (including
an easy way to filter your results), for some reason, there's still
no built-in way to sort the resulting file list. I guess it makes
sense... after all who would ever want to list their files ordered
by name, date, size, or type... that's just madness... or is it?
I use a similar approach to what I did with our classic ASP version.
In a nutshell, I transfer the file information into a DataTable
and use its built-in sorting mechanism to avoid having to do the
actual heavy lifting of storing and sorting the data. It's not
rocket science, but it's not exactly the most obvious approach either.
If nothing else, the code is a good example of how you can build and
use DataTables, DataRows, and DataViews without ever connecting to a
database. You can do the same with DataSets and other database
related objects... I just didn't have the need.