WebRequest - Directory Listing

C

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
 
N

Nicholas Paldino [.NET/C# MVP]

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

cj

Yup, thanks! Now I know not to beat my head looking for how to structure the
request!

Nicholas Paldino said:
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]
- (e-mail address removed)

cj said:
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
 

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

Top