WebClient登录和网站密码

时间:2012-08-25 16:53:13

标签: c# webclient

我正在尝试登录https://secure.domaintools.com/log-in/?logout(http://whois.domaintools.com)

using (var myWebClient = new WebClient())
{
    string loginData = "username=test@test.com&passowrd=pwd";

    string response = myWebClient.UploadString("https://secure.domaintools.com/log-in/?logout", "POST", loginData);

    myWebClient.Headers["User-Agent"] = "MOZILLA/5.0 (WINDOWS NT 6.1; WOW64) APPLEWEBKIT/537.1 (KHTML, LIKE GECKO) CHROME/21.0.1180.75 SAFARI/537.1";
    myWebClient.DownloadString("http://whois.domaintools.com");
    doc.LoadHtml(page);
}

但是有这个错误

  

错误417期望失败

我该如何解决?

1 个答案:

答案 0 :(得分:0)

将此属性添加到您的代码

ServicePointManager.Expect100Continue = false;
相关问题