WebRequest - Directory Listing

  • Thread starter Thread starter cj
  • Start date Start date
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
 
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.
 
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
 
Back
Top