How to get a site with WebClient class

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

To open needed site I have to give my ID and a password.
I can use webclient.downloadFile() to load an html text.
Is there a way to display this site using an webclient
object before calling downloadFile()?
Thanks,
Dave.
 
Dave said:
To open needed site I have to give my ID and a password.
I can use webclient.downloadFile() to load an html text.
Is there a way to display this site using an webclient
object before calling downloadFile()?

In theory yes -- you can send userid and password using
WebClient.UploadValues(). In practice I'm afraid you'll need to use
WebRequest/WebResponse, since WebClient does not handle cookies and most
web sites rely on cookies to implement session tracking.

Cheers,
 

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

Back
Top