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,
 
Back
Top