示例#1
0
 private void ChangePass(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!Validator.ValidTextBoxes(this.OldPassword.Password, this.NewPass.Password, this.RepNewPass.Password))
         {
             MessageBox.Show("Passwords not input");
         }
         else if (!Validator.CheckPassword(this.NewPass.Password, this.RepNewPass.Password))
         {
             MessageBox.Show("New passwords non Equal");
         }
         else if (!Validator.CheckPassword(thisUser.Password, Crypt.CryptPassword(this.OldPassword.Password)))
         {
             MessageBox.Show("Old passwords non Equal");
         }
         else
         {
             try
             {
                 thisUser.ChangePass(this.NewPass.Password);
                 ServerObject.SendMessage("13", thisUser.ToString());
                 MessageBox.Show("Password is changed");
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
 //constructor
 public User(string pName, string pSurName, string pNickName, string pGender,
             string pBirthday, string pCountry, string pCity, string pPassword)
 {
     this.Name     = pName;
     this.SurName  = pSurName;
     this.NickName = pNickName;
     this.Gender   = pGender;
     this.Birthday = pBirthday;
     this.Country  = pCountry;
     this.City     = pCity;
     this.Password = Crypt.CryptPassword(pPassword);
 }
示例#3
0
 public void ChangePass(string pass)
 {
     this.Password = Crypt.CryptPassword(pass);
 }
示例#4
0
 public User(string name, string password)
 {
     this.NickName = name;
     this.Password = Crypt.CryptPassword(password);
 }