473,320 Members | 1,977 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,320 software developers and data experts.

WebRequest - Directory Listing

cj
Hi,

I'm able to get the listing of (or "Index of") a directory on a
website/webserver using HttpWebRequest and HttpWebResponse, but it comes
back as an HTML page, similar to what IE or Mozilla/Firefox/Netscape would
show.

Is there anyway to get the listing in some other form, or do I just have to
parse the info myself?

Thanks,
cj
Nov 17 '05 #1
2 2888
CJ,

You will have to parse the information yourself, since this is what the
webserver is returning (that is the default for most websites, to generate
the HTML page when directory browsing is allowed).

If you have the ability to put code on the website, you might want to
create a webservice which will return the information in a better format,
or, at the least, return an XML page with some structured data.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"cj" <ch*********@chrisandkaren.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm able to get the listing of (or "Index of") a directory on a
website/webserver using HttpWebRequest and HttpWebResponse, but it comes
back as an HTML page, similar to what IE or Mozilla/Firefox/Netscape would
show.

Is there anyway to get the listing in some other form, or do I just have
to parse the info myself?

Thanks,
cj

Nov 17 '05 #2
cj
Yup, thanks! Now I know not to beat my head looking for how to structure the
request!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uT**************@TK2MSFTNGP15.phx.gbl...
CJ,

You will have to parse the information yourself, since this is what the
webserver is returning (that is the default for most websites, to generate
the HTML page when directory browsing is allowed).

If you have the ability to put code on the website, you might want to
create a webservice which will return the information in a better format,
or, at the least, return an XML page with some structured data.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"cj" <ch*********@chrisandkaren.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm able to get the listing of (or "Index of") a directory on a
website/webserver using HttpWebRequest and HttpWebResponse, but it comes
back as an HTML page, similar to what IE or Mozilla/Firefox/Netscape
would show.

Is there anyway to get the listing in some other form, or do I just have
to parse the info myself?

Thanks,
cj


Nov 17 '05 #3

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

Similar topics

19
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing =...
2
by: Tom | last post by:
I need to get a directory listing through http. If I put the directory path in the browser address bar such as http://somewebpage.com/subdir I get the listing of the directory. Of course this is...
8
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
1
by: Steven J. Reed | last post by:
I am trying to find out is a folder exists within a share on a server. I can successfully determine if a file exists within the share, but I can't figure out how to determine if it's parent folder...
8
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
4
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir...
1
by: Steve | last post by:
My site is hosted on a Godaddy reseller site. Godaddy only allows the use of Curl to access remote sites. What is the method for listing a directory after connecting to the site with Curl? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.