473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Creating links based on docs in a directory

Ok, I want to have a directory full of pdf files and a page that creates
links to them dynamically so that if I add 10 docs or subtract 7 or whatever,
they will be added or removed the next time the page is rendered. How do I
go about searching a directory and then creating links based on the filename
and location. Is this even possible?
Nov 19 '05 #1
2 1090
string folderPath = MapPath(folderName);
string[] fileList = System.IO.Directory.GetFiles(folderPath);
for(int i=0;i <= fileList.GetUpperBound(0);i++)
{
Response.Write fileList[i].ToString();
}

go from there, you should be able to do what you need.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Stephen Zachmann" <St*************@discussions.microsoft.com> wrote in
message news:9C**********************************@microsof t.com...
Ok, I want to have a directory full of pdf files and a page that creates
links to them dynamically so that if I add 10 docs or subtract 7 or
whatever,
they will be added or removed the next time the page is rendered. How do
I
go about searching a directory and then creating links based on the
filename
and location. Is this even possible?

Nov 19 '05 #2
>string folderPath = MapPath(folderName);
string[] fileList = System.IO.Directory.GetFiles(folderPath);
for(int i=0;i <= fileList.GetUpperBound(0);i++)
{
Response.Write fileList[i].ToString();
}

go from there, you should be able to do what you need.


Is there away of caching the link list and having the list regenerated
when the directory listing changes?

Sort of like a file dependency, but for a directory.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to...
3
by: epigram | last post by:
I've been creating some toy ASP.NET apps in an effort to understand the technology. I've something odd with regards to project/solution creation. If you create a new asp.net application, it...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
0
by: Chris | last post by:
Hi, I have a search function pulling data from a MySQL db which works nicely - other than the fact that I can't get the URL to link correctly when the linked document is located in the home...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.