private void btn_ok_Click(object sender, EventArgs e) { if (ub.GetMd5(txt_OldPassword.Text) != UsersHelp.Userslist[0].UserPassword) { MessageBox.Show("旧密码错误!"); txt_OldPassword.Text = ""; txt_OldPassword.Focus(); return; } if (la_passwordCheck.Text == "密码不一致!") { MessageBox.Show("密码不一致"); txt_DeterminePassword.Text = ""; txt_DeterminePassword.Focus(); return; } if (ub.UpdatePasswordBll(UsersHelp.Userslist[0].UserName, txt_NewPassword.Text.Trim(), "updateUsersPassword")) { MessageBox.Show("密码修改成功!"); this.Close(); } else { MessageBox.Show("密码修改失败!"); } }