2

我需要在网络上输入用户名/密码https://secure.domaintools.com/log-in/?logout

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
NameValueCollection nameValues = new NameValueCollection();
ServicePointManager.Expect100Continue = false;
nameValues.Add("username", "ipdnstest@gmail.com");
nameValues.Add("password", "ipdnstest");
using (var wc = new WebClient())
{
    wc.UploadValues("https://secure.domaintools.com/log-in/?logout", nameValues);
    wc.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";
    string page = wc.DownloadString("https://secure.domaintools.com/my-account/");
    doc.LoadHtml(page);
    doc.Save("f.htm");
}

但是在文件“f.htm”中仍然是https://secure.domaintools.com/log-in/?logout web,所以我没有登录成功

你能帮我解决这个问题吗?登录名/密码是真实的。

4

0 回答 0