how to make hyperlinks of existing files in a directory?

Discussion in 'ASP .Net' started by Ben, Nov 10, 2008.

  1. Ben

    Ben Guest

    Hi,

    there are a lot of files (unknown number), all ending with .aspx, in
    directory c:\inetpub\wwwroot\mydirectory\
    How can i make a hyperlink for each of those files and make that list of
    hyperlink available to the users?
    Thanks for help
    Ben
     
    Ben, Nov 10, 2008
    #1
    1. Advertising

  2. Ben

    Ben Guest

    ok, i found it: using Directory.GetFiles


    "Ben" <> schreef in bericht
    news:%...
    > Hi,
    >
    > there are a lot of files (unknown number), all ending with .aspx, in
    > directory c:\inetpub\wwwroot\mydirectory\
    > How can i make a hyperlink for each of those files and make that list of
    > hyperlink available to the users?
    > Thanks for help
    > Ben
    >
    >
    >
     
    Ben, Nov 10, 2008
    #2
    1. Advertising

  3. Ben

    Hillbilly Guest

    You can use this article [1] and many others found searching the web to
    learn to access the file system and retrieve folder and filenames. You can
    then use each filename as the value for an anchor element's href attribute
    and if wanted its title text. Use a foreach loop to write the results into a
    StringBuilder object you can then do something with. That's one common way
    to do what you asked about and all of it --every step-- can be found
    documented or blogged on the web at least 10 different ways.

    [1]
    http://aspalliance.com/920_Working_with_Files_and_Directories_using_ASPNET.all


    "Ben" <> wrote in message
    news:%...
    > Hi,
    >
    > there are a lot of files (unknown number), all ending with .aspx, in
    > directory c:\inetpub\wwwroot\mydirectory\
    > How can i make a hyperlink for each of those files and make that list of
    > hyperlink available to the users?
    > Thanks for help
    > Ben
    >
    >
    >
     
    Hillbilly, Nov 10, 2008
    #3
    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. Guest
    Replies:
    0
    Views:
    437
    Guest
    Aug 19, 2003
  2. TJS
    Replies:
    1
    Views:
    527
    Eliyahu Goldin
    Jun 23, 2004
  3. =?Utf-8?B?QmFzIEhlbmRyaWtz?=

    Directory and files names in temporary asp.net directory

    =?Utf-8?B?QmFzIEhlbmRyaWtz?=, Jan 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    853
    Juan T. Llibre
    Jan 31, 2005
  4. nrm
    Replies:
    3
    Views:
    558
  5. Replies:
    0
    Views:
    201
Loading...

Share This Page