private void ucBtnChangePwd_BtnClick(object sender, EventArgs e) { FrmInputs frm = new FrmInputs("修改密码", new string[] { "旧密码", "新密码", "确定密码" }, new Dictionary <string, HZH_Controls.TextInputType>() { }, new Dictionary <string, string>() { }, new Dictionary <string, KeyBoardType>() { { "旧密码", KeyBoardType.UCKeyBorderAll_EN }, { "新密码", KeyBoardType.UCKeyBorderAll_EN } }, new List <string>() { "旧密码", "新密码", "确定密码" }); frm.ShowDialog(this); if (frm.DialogResult == DialogResult.OK) { string oldPwd = frm.Values[0]; string newPwd = frm.Values[1]; string comPwd = frm.Values[2]; if (newPwd != comPwd) { MessageBox.Show("两次密码不一致"); return; } //if (!Check.isPwd(newPwd)) // { // MessageBox.Show("密码最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符"); // return; // } if (MD5Encode.GetMd5(oldPwd) == teacher.PassWord) { TeacherBLL bll = new TeacherBLL(); string msg = bll.EditPwd(MD5Encode.GetMd5(newPwd), teacher.TID)?"修改成功":"修改失败"; MessageBox.Show(msg); } else { MessageBox.Show("原密码错误"); } } }