Display a list of files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to get a list of files in a directory, say c:\temp, and display it in
a drop down list. How would I do that?
 
Thanks, that works. Now I want to display the list sorted by date, so that
the most recent date is at the top of the list and automatically selected in
the drop down list. how would I do that?
 
Thanks, that works. Now I want to display the list sorted by date, so
that the most recent date is at the top of the list

There's no built-in way to do that just with the GetFiles method. However,
what you require is easily achieved by adding the results to a generic and
sorting that:
http://blogs.msdn.com/markda/archive/2006/04/20/580075.aspx
and automatically selected in the drop down list.

Unless you specify otherwise, the first item in your DropDownList will be
selected by default.
 
Back
Top