473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List off all files in a website

AAJ
Hi all

Is it possible to programatically list all the .aspx files within the
currenty running website.

e.g. something like
foreach {aspxfile in AllaspxFilesInM yProject)
{
string filename = aspxfile.title;
}

thanks

Andy

May 26 '06 #1
4 3569
no, its not that easy unfortunately.

You can list all the aspx pages using recursion quite easily if you have
access to the directory structure, open and read each as a text file and
pick out any title tags.

Alternatively, you could create a spider that requests pages and follows
links, assuming your site can be followed. Then you can pick out the
information you need. There are spider examples around, and recursione
examples.

--
Regards

John Timney
Microsoft MVP

"AAJ" <a.a.com> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi all

Is it possible to programatically list all the .aspx files within the
currenty running website.

e.g. something like
foreach {aspxfile in AllaspxFilesInM yProject)
{
string filename = aspxfile.title;
}

thanks

Andy

May 26 '06 #2
"John Timney ( MVP )" wrote l...
You can list all the aspx pages using recursion quite easily if you have
access to the directory structure, open and read each as a text file and
pick out any title tags.


Hi all,

Feel free to reprimand me with a virtual *SLAP* I'm wrong, but instead of
running through the contents of each page, if you have access to the
directory structure, wouldn't grabbing the file name and looking for files
ending .aspx be quicker?

Regards

Rob
May 26 '06 #3
AAJ
Thanks guys

I was hoping there was some sort of pre existsing 'website' object that
held a collection of all the pages.

not to worry, I have full access so directory recursion it will be

cheers

Andy
"AAJ" <a.a.com> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi all

Is it possible to programatically list all the .aspx files within the
currenty running website.

e.g. something like
foreach {aspxfile in AllaspxFilesInM yProject)
{
string filename = aspxfile.title;
}

thanks

Andy

May 26 '06 #4
Lol............ .thats what I actually suggested, but his code examples
requests extracting the title of each page - consider yourself lightly
splapped!

--
Regards

John Timney
Microsoft MVP

"Rob Meade" <ku************ ***@edaem.bor> wrote in message
news:uc******** ******@TK2MSFTN GP04.phx.gbl...
"John Timney ( MVP )" wrote l...
You can list all the aspx pages using recursion quite easily if you have
access to the directory structure, open and read each as a text file and
pick out any title tags.


Hi all,

Feel free to reprimand me with a virtual *SLAP* I'm wrong, but instead of
running through the contents of each page, if you have access to the
directory structure, wouldn't grabbing the file name and looking for files
ending .aspx be quicker?

Regards

Rob

May 26 '06 #5

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

Similar topics

1
11081
by: J P Singh | last post by:
Hi All I want to create a webpage which will list all the files in particular folder and hyperlink to them to allow users to view the grpahics online without having to send each file to them by email. I got the following code but gives me a VBScript error. I have created a folder called files under the home directory of this website and have added the name of the folder
3
14095
by: Hamed | last post by:
Dear Folks I am programming a page that asks user a directory name and lists files of type *.xls in the directory in client's machine. He/She will then select some files to upload them to the server. Is there any way to ask a directory name and then list the files of that directory in client's machine? The typical browser that is used is IE but I am not allowed to use ActiveX objects.
1
2503
by: cs | last post by:
foreach (string file in Directory.GetFiles( System.Environment.GetFolderPath (System.Environment.SpecialFolder.InternetCache)) ) { Console.WriteLine(file.ToString()); } I can only get the code above to list desktop.ini and no other files. What's going on with this folder?
8
2395
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to output correctly, i have included the original code, my modified code, and the output from my modifed code.. why does it list the files as "System.IO.FileInfo"??? thanks
7
32908
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
1
2571
by: mmohanra | last post by:
I am trying to list files in a folder in a remote server. I am using Scripting.FileSystemObject. This seems to be really slow. After a long time the connection times out. Is there any other way to list files in a folder? Below is the current code: Dim fs, f, fc Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(Whichfolder) Set fc = f.files We were using Scripting.FileSystemObject for uploading files to...
3
51500
by: Killer42 | last post by:
Here's a simple VB6 code snippet that uses the FileSystemObject model to find all the files in C:\Temp and load their names into a listbox. To use this sample, you need to set things up as follows: Create a new project in VB6 Add a form (this will probably happen by default, anyway) Pull down the Project menu and choose References. Find Microsoft Scripting Runtime and fill in the checkbox to select it. Click OK. Add a ListBox control to...
3
2623
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I want those files to be able to view in client browser. when i tested using server computer it succeed. but from client computer i got nothing. I checked the html sources and the files is directly loaded from "d:/
4
2264
by: tur130 | last post by:
I have a whole bunch of files called xxx_Page1.htm at a domain, where xxx is a type of animal. I have a script that iterates through a known list of animals setting MyVar for each one. The following line works just fine at bringing these files on to a web page inside MyDiv: document.getElementById('MyDiv').innerHTML = "<iframe src='"+MyVar+"_Page1.htm'></iframe>"; However the the files at the server are being added to all the time. I...
1
3194
by: CSS Newbie | last post by:
So I want to use a javascript photo gallery widget I found...but it requires me to enter a comma delimited list of all the photo files I want to use. I want to show all the picture files within the specified directory without having to enumerate them (because the number and names of the photos will change often and this page will be replicated often for different directories). Is there a relatively easy (because I'm just learning) way to...
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
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
9241
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...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
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
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.