📄 mobilephonepage.cs
字号:
this.pbLoading.TabStop = false;
this.pbLoading.Visible = false;
this.lbLoading.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
this.lbLoading.BorderColor = Color.Empty;
this.lbLoading.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbLoading.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
this.lbLoading.Location = new Point(0x48, 0x7c);
this.lbLoading.Name = "lbLoading";
this.lbLoading.Size = new Size(0x120, 0x34);
this.lbLoading.TabIndex = 40;
this.lbLoading.Text = "正在通过网络获取图形验证码,请稍候!";
this.lbLoading.UseMnemonic = false;
this.lbLoading.Visible = false;
this.lbMobileNo.set_AutoSize(true);
this.lbMobileNo.BorderColor = Color.Empty;
this.lbMobileNo.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbMobileNo.Font = new Font("宋体", 9f);
this.lbMobileNo.Location = new Point(0x13, 0x37);
this.lbMobileNo.Name = "lbMobileNo";
this.lbMobileNo.Size = new Size(0x35, 12);
this.lbMobileNo.TabIndex = 0x1a;
this.lbMobileNo.Text = "手机号:";
this.lbMobileNo.UseMnemonic = false;
this.txtMobileNo.BackColor = Color.White;
this.txtMobileNo.BorderStyle = BorderStyle.FixedSingle;
this.txtMobileNo.EmptyTextTip = "请输入中国移动手机号码";
this.txtMobileNo.EmptyTextTipColor = Color.DarkGray;
this.txtMobileNo.Location = new Point(0x48, 0x33);
this.txtMobileNo.MaxLength = 11;
this.txtMobileNo.Name = "txtMobileNo";
this.txtMobileNo.Size = new Size(0x91, 0x15);
this.txtMobileNo.TabIndex = 0x16;
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.txtMobileNo);
this.groupBox1.Controls.Add(this.lbMobileNo);
this.groupBox1.Controls.Add(this.lbLoading);
this.groupBox1.Controls.Add(this.pbLoading);
this.groupBox1.Controls.Add(this.txtValiCode);
this.groupBox1.Controls.Add(this.pbValiCode);
this.groupBox1.Controls.Add(this.lbValiCode);
this.groupBox1.Dock = DockStyle.Top;
this.groupBox1.Location = new Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(380, 0xbc);
this.groupBox1.TabIndex = 0x2a;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "PC设置密码";
this.label1.set_AutoSize(true);
this.label1.Location = new Point(0x13, 0x1a);
this.label1.Name = "label1";
this.label1.Size = new Size(0x13d, 12);
this.label1.TabIndex = 0x29;
this.label1.Text = "请输入手机号和验证码,系统将发送确认码到您的手机上。";
this.groupBox2.Controls.Add(this.lbSmsKtTip);
this.groupBox2.Dock = DockStyle.Fill;
this.groupBox2.Location = new Point(0, 0xbc);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new Size(380, 0x70);
this.groupBox2.TabIndex = 0x2b;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "短信设置密码";
base.set_AutoScaleDimensions(new SizeF(6f, 12f));
base.set_AutoScaleMode(1);
base.Controls.Add(this.groupBox2);
base.Controls.Add(this.groupBox1);
base.Name = "MobilePhonePage";
base.Size = new Size(380, 300);
this.pbValiCode.EndInit();
this.pbLoading.EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
base.ResumeLayout(false);
}
private void LoadResource()
{
if (base._host.passwordData.ImgCertCode != null)
{
this.pbValiCode.Image = base._host.passwordData.ImgCertCode;
}
this.lbSmsKtTip.Text = string.Format(this.lbSmsKtTip.Text, Imps.Client.Core.FixedClientSetting.Instance.KTSmsCode, Imps.Client.Core.FixedClientSetting.Instance.SmsNo);
}
private void MobilePhonePage_Disposed(object sender, EventArgs e)
{
this.DetachEventHandler();
}
private void MobilePhonePage_Load(object sender, EventArgs e)
{
this.txtMobileNo.Text = base._host.passwordData.MobileNo;
this.txtValiCode.Text = string.Empty;
if (!base._host.passwordData.Flag.SysCfgInited)
{
base._host.LoadSysCfg();
}
else
{
ModifyPassword.GetCertPic(base._host.passwordData);
}
}
private void ModifyPassword_OnCertPicRecived(object sender, CertPicEventArgs e)
{
if (string.IsNullOrEmpty(e.ErrorMessage))
{
if ((e.CertPic != null) && (e.SessionID.Length > 0))
{
base._host.passwordData.PicCertSessionId = e.SessionID;
this.pbValiCode.Image = e.CertPic;
base._host.passwordData.ImgCertCode = e.CertPic;
base._host.passwordData.Flag.CertPicRecived = true;
this.txtValiCode.Enabled = true;
this.ShowFormIssue(true);
this.ShowLoading(false);
base._host.EnableNextStep(true);
}
else
{
base._host.passwordData.Flag.CertPicRecived = false;
BalloonHelper.ShowBallon(this.pbValiCode, string.Format("无法获取图形验证码,错误码:{0}", ModifyPasswordBizCode.GetErrorCode(0x44d, e.WebException)), "错误", 3, 0x3e8);
this.ShowLoadError(0x44d, e);
}
}
else
{
base._host.passwordData.Flag.CertPicRecived = false;
BalloonHelper.ShowBallon(this.pbValiCode, string.Format("无法获取图形验证码,错误码:{0}", ModifyPasswordBizCode.GetErrorCode(0x44d, e.WebException)), "错误", 3, 0x3e8);
this.ShowLoadError(0x44d, e);
}
}
private void ModifyPassword_OnSmsCertCodeRequestSended(object sender, CertSmsEventArgs e)
{
if (!string.IsNullOrEmpty(e.ErrorMessage))
{
if (e.HttpStautsCode == 400)
{
this.txtValiCode.SelectAll();
this.pbValiCode.Image = null;
ModifyPassword.GetCertPic(base._host.passwordData);
this.txtValiCode.Enabled = false;
this.txtValiCode.Enabled = false;
}
else if (e.HttpStautsCode == 0x1a7)
{
e.ErrorMessage = string.Format("对不起,您重试次数太多,请稍候再试!错误码:{0}", ProvisionBizCode.GetErrorCode(0x44f, e.WebException));
}
this.RestoreAllControlsStatus();
base._host.canSendSmsRequest = true;
}
else
{
base._host.passwordData.Flag.SmsRequestSended = true;
}
base._host.EnableNextStep(true);
base.FireMoveNextEvent(this, e);
}
public override void MoveToNextStage()
{
if (!base._host.passwordData.Flag.SysCfgInited || !base._host.passwordData.Flag.CertPicRecived)
{
BalloonHelper.ShowBallon(this.pbValiCode, "没有成功获取图形验证码!", "错误", 3, 0x3e8);
}
else if (this.GetValidData())
{
ModifyPassword.GetSmsCertCode(base._host.passwordData);
if (!base._host.smsTimer.Enabled)
{
base._host.smsTimer.Enabled = true;
}
base._host.canSendSmsRequest = false;
base._host.smsTickCounter = 0;
this.DisableAllControls();
}
}
protected override void RestoreAllControlsStatus()
{
this.txtMobileNo.Enabled = true;
this.txtValiCode.Enabled = true;
base._host.SetButtonStatus(this);
}
private void ShowFormIssue(bool enable)
{
this.txtValiCode.Enabled = enable;
}
private void ShowLoadError(int bizCode, HttpAppEventArgs e)
{
this.pbLoading.Image = ImpsResources.GetImage("Images.cancel.png");
string text = "错误:获取";
if (!base._host.passwordData.Flag.CertPicRecived)
{
text = text + "图形验证码";
}
if (e == null)
{
text = text + "失败!";
}
else if (e.WebException == null)
{
text = text + "失败!";
}
else
{
text = string.Format(text + "失败\r\n错误码:{0}。", ModifyPasswordBizCode.GetErrorCode(bizCode, e.WebException));
}
this.lbLoading.Text = text;
}
private void ShowLoading(bool p)
{
this.pbLoading.Visible = p;
this.lbLoading.Visible = p;
}
public override bool CanMoveNext
{
get
{
return base._host.passwordData.Flag.CertPicRecived;
}
}
public override bool CanMovePrivious
{
get
{
return false;
}
}
public override PasswordStage NextStage
{
get
{
return PasswordStage.Password;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -