Click here to Skip to main content
15,888,301 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I login to a website using a webclient object in VB.Net. Does anyone have tried this before? Please will you share some of the techniques? Thanks

What I have tried:

<br />
Dim wclient As New WebClient<br />
Dim loginInfo As New Specialized.NameValueCollection<br />
loginInfo.Add("username", "guest")<br />
loginInfo.Add("password", "sample123")<br />
wclient.UploadValues("<thesitehere>", "POST", loginInfo)<br />
<br />
Dim pagesource as String = client.DownloadString(<"I want navigate to some pages of the site, so I put the link here>")


but still I get the page source of the login part of the site.
Posted
Updated 28-Nov-16 4:59am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900