473,626 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1099
string folderPath = MapPath(folderN ame);
string[] fileList = System.IO.Direc tory.GetFiles(f olderPath);
for(int i=0;i <= fileList.GetUpp erBound(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.m icrosoft.com> wrote in
message news:9C******** *************** ***********@mic rosoft.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(folderN ame);
string[] fileList = System.IO.Direc tory.GetFiles(f olderPath);
for(int i=0;i <= fileList.GetUpp erBound(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
2550
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 strip out any part of RestrictedPython that's not necessary for doing capabilities and do all security using just capabilities. The basic idea behind capabilities is that you don't give any piece of code you don't trust a reference to something...
3
1948
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 appears that the project files get created in the URL specified Location field on the New Project dialog box. This makes sense to me. What is confusing is that the solution file gets created in a folder with the same name as the location folder (the...
12
3153
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 restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
0
1099
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 directory. All other docs are located below the home directory by group/project/category. When I try to use an 'if' statement for one of the query parameters, I either lose the link, get a link that has the doc that is in the home directory with the...
0
8203
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8368
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.