private void button_AdminOK_Click(object sender, EventArgs e) { if (this.textBox_AdminPassword.Text == "") { this.textBox_AdminPassword.Focus(); return; } if (this.isUser) { if (this.checkBox_RememberInfo.Checked) { Settings.Default.GprsRememberUser = true; Settings.Default.GPRSUsername = this.textBox_AdminName.Text; Settings.Default.GPRSPassword = this.textBox_AdminPassword.Text; Settings.Default.Save(); } else { Settings.Default.GprsRememberUser = false; Settings.Default.GPRSUsername = ""; Settings.Default.GPRSPassword = ""; Settings.Default.Save(); } if (GprsAdministrator.API_UserLogin(this.textBox_AdminName.Text.Trim(), this.textBox_AdminPassword.Text.Trim())) { GprsAdministrator.LoginSuccess = true; base.Dispose(); return; } this.VisiblePnlMessage(true, "登录名或密码错误"); this.LoginTimes++; GprsAdministrator.LoginSuccess = false; if (this.LoginTimes >= 3) { base.Dispose(); return; } } else { if (this.IsForBind) { formGPRSAdminLogin.bindUserName = this.textBox_AdminName.Text; formGPRSAdminLogin.bindPassword = this.textBox_AdminPassword.Text; base.Dispose(); return; } if (GprsAdministrator.API_AdminLogin(this.textBox_AdminName.Text.Trim(), this.textBox_AdminPassword.Text.Trim())) { GprsAdministrator.LoginSuccess = true; base.Dispose(); return; } this.VisiblePnlMessage(true, "登录名或密码错误"); this.LoginTimes++; GprsAdministrator.LoginSuccess = false; if (this.LoginTimes >= 3) { base.Dispose(); } } }