List off all files in a website

A

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 AllaspxFilesInMyProject)
{
string filename = aspxfile.title;
}

thanks

Andy
 
J

John Timney \( MVP \)

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.
 
R

Rob Meade

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
 
A

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
 
J

John Timney \( MVP \)

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

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top