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);
        }
        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;
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// 发送验证码点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonVerify_Click(object sender, EventArgs e)
        {
            if (!ClassStatic.tcpClient.IsConnected || buttonVerify.Cursor == Cursors.No)
            {
                return;
            }

            string account = inputAccount.Text;

            if (!ClassStatic.IsPhone(account))
            {
                LabelTipShow("请输入正确的手机号再试");
                return;
            }

            Action <bool, byte[]> action = new Action <bool, byte[]>(ButtonVerify_Callback);

            ClassStatic.tcpClient.Send(106, System.Text.Encoding.UTF8.GetBytes(account), action);
        }