Ejemplo n.º 1
0
        private void ChangePasswordButton_Click(object sender, RoutedEventArgs e)
        {
            if (0 == OldPasswordBox.Password.Length)
            {
                MessageBox.Show("请输入原密码!");
                return;
            }
            if (0 == NewPasswordBox.Password.Length)
            {
                MessageBox.Show("请输入新密码!");
                return;
            }
            if (0 == NewPasswordBox2.Password.Length)
            {
                MessageBox.Show("请输入密码确认!");
                return;
            }
            if (NewPasswordBox.Password != NewPasswordBox2.Password)
            {
                MessageBox.Show("新密码与密码确认不一致!");
                return;
            }
            string oldpw = OldPasswordBox.Password;
            string newpw = NewPasswordBox.Password;

            if (ChangeRootPassword(oldpw, newpw))
            {
                MessageBox.Show("修改成功!");
                OldPasswordBox.Clear();
                NewPasswordBox.Clear();
                NewPasswordBox2.Clear();
            }
            else
            {
                MessageBox.Show("修改失败!");
            }
        }
Ejemplo n.º 2
0
 private void NewPasswordBoxClick2(object sender, MouseButtonEventArgs e)
 {
     NewPasswordBox2.Clear();
 }