/// <summary> /// 修改密码按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSubmit_Click(object sender, EventArgs e) { if (!ClassStatic.tcpClient.IsConnected) { return; } string account = inputAccount.Text; string verify = inputVerify.Text; string password = inputPassword.Text; if (!ClassStatic.IsPhone(account)) { LabelTipShow("请输入正确的手机号"); return; } if (verify.Length != 6) { LabelTipShow("请输入正确的验证码"); return; } if (!ClassStatic.IsComplexPass(password)) { LabelTipShow("请输入8位以上的复杂密码"); return; } ClassStatic.ClientData clientData = new ClassStatic.ClientData(account, password, verify); Action <bool, byte[]> action = new Action <bool, byte[]>(ButtonSubmit_Callback); ClassStatic.tcpClient.Send(107, ClassStatic.SetClientDataByte(clientData), action); }
public void InitializeControl() { ForeColor = Color.Black; inputAccount.Tips = "请输入手机号"; inputPassword.Tips = "请输入至少8位的密码"; // 账号 string account = ClassStatic.GetConfig("account"); // 头像 string portrait = ClassStatic.GetConfig("portrait"); // 密码 string password = ClassStatic.GetConfig("password"); // 记住密码 string remember = ClassStatic.GetConfig("remember"); ClassStatic.portraitPid = (portrait == "") ? 0 : Convert.ToInt32(portrait); controlPortraitBox.Portrait = ClassStatic.portraitPid; if (ClassStatic.IsPhone(account)) { inputAccount.Text = account; if (ClassStatic.IsComplexPass(password)) { inputPassword.Text = password; if (remember == "true") { checkBoxRemember.Checked = true; } } } }