Display a list of files

Discussion in 'ASP .Net' started by Guest, Oct 15, 2007.

  1. Guest

    Guest 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?
     
    Guest, Oct 15, 2007
    #1
    1. Advertisements

  2. Juan T. Llibre, Oct 15, 2007
    #2
    1. Advertisements

  3. Mark Rae [MVP], Oct 15, 2007
    #3
  4. Guest

    Guest Guest

    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?

    <tester> wrote in message news:...
    >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?
    >
     
    Guest, Oct 19, 2007
    #4
  5. <tester> wrote in message news:...

    > 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.


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Oct 19, 2007
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rob hadow

    JAR files reading list files

    rob hadow, May 21, 2004, in forum: Java
    Replies:
    4
    Views:
    4,987
    rob hadow
    May 21, 2004
  2. crazyprakash
    Replies:
    4
    Views:
    3,691
    adrian
    Oct 30, 2005
  3. roopa
    Replies:
    6
    Views:
    1,040
    Jerry Coffin
    Aug 27, 2004
  4. Replies:
    4
    Views:
    1,247
    M.E.Farmer
    Feb 13, 2005
  5. Replies:
    4
    Views:
    2,392
  6. dackz
    Replies:
    0
    Views:
    619
    dackz
    Feb 6, 2007
  7. Debajit Adhikary
    Replies:
    17
    Views:
    964
    Debajit Adhikary
    Oct 18, 2007
  8. Replies:
    3
    Views:
    1,912
    Rolf Magnus
    Jan 18, 2009
Loading...