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 (MD5Encode.GetMd5(oldPwd) == student.PassWord) { StudentBLL bll = new StudentBLL(); string msg = bll.EditPwd(MD5Encode.GetMd5(newPwd), student.SID) ? "修改成功" : "修改失败"; MessageBox.Show(msg); } else { MessageBox.Show("原密码错误"); } } }