What does WebClient.UploadString do?
I thought it post so i can login with it. When i used wc.UploadString(@"http://mysite.com/login", "user=u&pass=p"); i thought i would get the html of the front page with me logged in. However all i got was no warning that my pass was incorrect and my method=post note at the bottom.
What does WebClient.UploadString really do? and how can i login with WebClient?
The second parameter is passing data in the post body. You've formatted it to be part of the querystring. If the username/password are really passed in the querystring they should be included in the first parameter (the url). Otherwise, which is more likely, if they are to be sent as form parameters, then use UploadValues as Andrei suggested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With