我使用 webbrower 为 gmail 注册表单设置自动值,当我填写验证码并提交时,服务器给出消息“对不起,我们目前无法满足您对新帐户的请求。”。我注册手册就成功了。你能解释一下为什么吗?
这是我的代码。
HtmlElement element = webBrowser1.Document.GetElementById("LastName");
if (element != null) {
string lastName = "LastName";
element.InnerText = lastName;
}
element = webBrowser1.Document.GetElementById("lastname-placeholder");
if (element != null) { element.InnerText = ""; }
// First Name
element = webBrowser1.Document.GetElementById("firstname-placeholder");
if (element != null)
{
element.InnerText = "";
}
element = webBrowser1.Document.GetElementById("FirstName");
if (element != null) {
string firstName = "firstName";
element.InnerText = firstName;
element.InvokeMember("onblur");
}
element = webBrowser1.Document.GetElementById("GmailAddress");
if (element != null)
{
string account="abcxxx";//
element.InnerText = account;
element.InvokeMember("onblur");
element.InvokeMember("onChange");
element.InvokeMember("onFocus");
}
// Password
string password = "abc123xxx";
element = webBrowser1.Document.GetElementById("Passwd");
if (element != null) {
element.InnerText = password;
emailCreated.Password = password;
element.InvokeMember("onFocus");
element.InvokeMember("onblur"); element.InvokeMember("onChange");
}
element = webBrowser1.Document.GetElementById("PasswdAgain");
if (element != null) { element.InnerText = password; element.InvokeMember("onFocus"); element.InvokeMember("onblur"); element.InvokeMember("onChange"); }
// Day
element = webBrowser1.Document.GetElementById("birthday-placeholder");
if (element != null)
{
element.InnerText = "";
}
element = webBrowser1.Document.GetElementById("BirthDay");
if (element != null) { element.InnerText = "14"; element.InvokeMember("onblur"); }
// Month
element = webBrowser1.Document.GetElementById("BirthMonth");
if (element != null)
{
element.SetAttribute("SelectedIndex", "2"); element.InvokeMember("onblur");
}
element = webBrowser1.Document.GetElementById("HiddenBirthMonth");
if (element != null)
{
element.InnerText = "02";
}
//Year
element = webBrowser1.Document.GetElementById("birthYear-placeholder");
if (element != null)
{
element.InnerText = "";
}
element = webBrowser1.Document.GetElementById("BirthYear");
if (element != null) { element.InnerText = "1986"; element.InvokeMember("onblur"); }
// Gender
element = webBrowser1.Document.GetElementById("Gender");
if (element != null) { element.SetAttribute("SelectedIndex", "1"); element.InvokeMember("onblur"); }
element = webBrowser1.Document.GetElementById("HiddenGender");
if (element != null) { element.InnerText = "FEMALE"; element.SetAttribute("value", "FEMALE"); element.InvokeMember("onblur"); }
//RecoveryPhoneNumber
element = webBrowser1.Document.GetElementById("RecoveryPhoneNumber");
element.InnerText = txtMobileRecover.Text;
element = webBrowser1.Document.GetElementById("RecoveryEmailAddress");
element.InnerText="mailabcxxx@gmail.com"
//TermsOfService
element = webBrowser1.Document.GetElementById("TermsOfService");
if (element != null) { element.SetAttribute("checked", "true"); element.InvokeMember("onblur"); }
//HomepageSet
element = webBrowser1.Document.GetElementById("HomepageSet");
if (element != null) { element.SetAttribute("checked", ""); element.InvokeMember("onblur"); }
// images