Open Web Directory

M

marcusadeleon

Hi,

I was wondering how to open up a web directory to get a file listing.

The directory I want to open allows directory listings, but has a
directory password. Meaning it gives me a prompt to put in a username
and password when I go to the web address in internet explorer. Once I
put in the correct username and password, it shows the directory
listing.

Thanks,

Marcus de Leon
 
V

Vadym Stetsiak

Hello, (e-mail address removed)!

That listing is server-generated HTML file that looks like directory
listing.

So, you have following options:
1. parse HTML returned by the server and detect file/dir links
2. get ftp access to that folder.

For the 1-st way HttpWebRequest/HttpWebResponse will be needed.
For the 2-nd - FtpWebRequest/FtpWebResponse

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com


You wrote on Wed, 12 Sep 2007 05:11:07 -0700:

m> Hi,

m> I was wondering how to open up a web directory to get a file listing.

m> The directory I want to open allows directory listings, but has a
m> directory password. Meaning it gives me a prompt to put in a username
m> and password when I go to the web address in internet explorer. Once
m> I put in the correct username and password, it shows the directory
m> listing.

m> Thanks,

m> Marcus de Leon
 
S

ShlomyS

Hi,

I was wondering how to open up a web directory to get a file listing.

The directory I want to open allows directory listings, but has a
directory password. Meaning it gives me a prompt to put in a username
and password when I go to the web address in internet explorer. Once I
put in the correct username and password, it shows the directory
listing.

Thanks,

Marcus de Leon

You can use webclient object. for example:

WebClient wc = new WebClient();
wc.Credentials = new NetworkCredential("username", "password",
"domain");
wc.DownloadData("address");

and then parse the returned html. But, it will be better to define FTP
and use it.
 

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