how to make hyperlinks of existing files in a directory?

B

Ben

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
 
H

Hillbilly

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top