Post with webclient doesnt work
-
Hi all, I have a problem trying to log in this spanish web: http://www.infojobs.net. The login web is this: http://www.infojobs.net/candidato\_login.cfm For testing, I have created this user/pass: email/nick: testforlogin@hotmail.com pass: 1234 So, I've tried two ways: Option 1: string login = https://www.infojobs.net/candidato\_login\_run.cfm; NameValueCollection postdata=new NameValueCollection(); postdata.Add("email", "textBoxName.Text"); postdata.Add("password", textBoxPass.Text); byte[] data = clientWeb.UploadValues(new Uri(login), postdata); string page = Encoding.Default.GetString(data); Option 2: clientWeb.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); string data = "email=" + textBoxName.Text + "&e_password=" + textBoxPass.Text; byte[] postArray = Encoding.ASCII.GetBytes(data); byte[] responseArray = clientWeb.UploadData(login, "POST", postArray); string paginaresultado = Encoding.Default.GetString(responseArray); Also, clientWeb is an extended WebClient class that manage cookies. And the login is always wrong :(. Any ideas? Thanks in advanced. Regards