Example #1
0
        public FrmLogin()
        {
            InitializeComponent();

            ConfigBLL bll = new ConfigBLL();
            if (bll.IsStartVoiceLogin)
            {
                OpenVoice();
            }
        }
Example #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (CheckInput())
     {
         string oldPw = MD5Encrypt.GetStrMD5(MD5Encrypt.GetStrMD5(txtOldPw.Text));
         ConfigBLL bll = new ConfigBLL();
         string loginPw = bll.LoginPW;
         if (loginPw.Equals(oldPw))
         {
             loginPw = MD5Encrypt.GetStrMD5(MD5Encrypt.GetStrMD5(txtNewPw.Text));
             bll.LoginPW = loginPw;
             MessageBox.Show("修改密码成功!");
             this.Close();
         }
         else
         {
             ShowErrorMsg(txtOldPw, "原密码输入错误,请重新输入!");
         }
     }
 }
Example #3
0
 private void cbStartVoiceLogin_CheckedChanged(object sender, EventArgs e)
 {
     ConfigBLL bll = new ConfigBLL();
     bll.IsStartVoiceLogin = cbStartVoiceLogin.Checked;
 }
Example #4
0
 private FrmConfig()
 {
     InitializeComponent();
     ConfigBLL bll = new ConfigBLL();
     cbStartVoiceLogin.Checked = bll.IsStartVoiceLogin;
 }
Example #5
0
 /// <summary>
 /// 检查登录密码是否正确
 /// </summary>
 /// <returns></returns>
 private bool CheckPw(string pw)
 {
     string loginPw = CommonHelper.GetMD5Str(pw);
     ConfigBLL bll = new ConfigBLL();
     string realPw = bll.LoginPW;
     if (realPw.Equals(loginPw))
     {
         return true;
     }
     return false;
 }
Example #6
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (CheckPw(txtPw.Text))
     {
         ConfigBLL bll = new ConfigBLL();
         if (sh!= null)
         {
             sh.CloseRec();
         }
         this.Hide();
         FrmMain fm = new FrmMain();
         fm.Show();
     }
     else
     {
         this.errorProvider1.SetError(this.txtPw, "登录密码输入错误,请重新输入!");
         txtPw.Focus();
     }
 }