0

我正在尝试登录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 预期失败

我该如何解决?

4

1 回答 1

0

将此属性添加到您的代码中

ServicePointManager.Expect100Continue = false;
于 2012-08-25T19:54:01.990 回答