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

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

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

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. Imran Aziz
    Replies:
    4
    Views:
    1,543
    Imran Aziz
    Aug 11, 2005
  2. Marc Twain

    Display and display model

    Marc Twain, Jan 13, 2004, in forum: Java
    Replies:
    1
    Views:
    395
    Matt Humphrey
    Jan 13, 2004
  3. SG
    Replies:
    6
    Views:
    30,770
    ricuzzo
    Jan 15, 2008
  4. blank101
    Replies:
    2
    Views:
    552
    blank101
    Feb 5, 2005
  5. Replies:
    4
    Views:
    2,178
Loading...

Share This Page