示例#1
0
 private void deleteButton_Click(object sender, EventArgs e)
 {
     this.passwordLabel.Visible = false;
     if (!string.IsNullOrWhiteSpace(this.passwordTextBox.Text))
     {
         string hashedPass = HashUtilities.HashPassword(this.passwordTextBox.Text);
         if (hashedPass == RegistryData.GetUserPassword(this.User.Username))
         {
             RegistryData.DeleteAccout(this.User.Username);
             MetroMessageBox.Show(this.MainForm, string.Empty, GlobalMessages.AccountDeleted
                                  , MessageBoxButtons.OK, MessageBoxIcon.Information, 80);
             this.Swipe(false);
             this.userPanel.Logout();
         }
         else
         {
             this.passwordLabel.Visible = true;
         }
     }
 }