Beispiel #1
0
        /// <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);
        }
        private void labelLogin_Click(object sender, EventArgs e)
        {
            labelLogin.Focus();
            if (!ClassStatic.tcpClient.IsConnected)
            {
                return;
            }

            string account  = inputAccount.Text;
            string password = inputPassword.Text;

            if (!ClassStatic.IsPhone(account))
            {
                FormLogin.formLogin.LabelTipShow("请输入正确的手机号再登录");
                return;
            }
            if (password.Length == 0)
            {
                FormLogin.formLogin.LabelTipShow("请输入密码后再登录");
                return;
            }

            ClassStatic.ClientData clientData = new ClassStatic.ClientData(account, password);
            Action <bool, byte[]>  action     = new Action <bool, byte[]>(LabelLogin_Callback);

            ClassStatic.tcpClient.Send(101, ClassStatic.SetClientDataByte(clientData), action);
        }