コード例 #1
0
        public void SaveSettings()
        {
            var pwd = new PasswordEncoder();

            var logins = Logins;

            foreach (var login in logins)
            {
                login.Password = pwd.EncryptWithByteArray(login.Password);
            }

            Properties.Settings.Default.Logins = JsonConvert.SerializeObject(logins);
            Properties.Settings.Default.Save();
        }
コード例 #2
0
        private void BTN_LogIn_Click(object sender, RoutedEventArgs e)
        {
            PasswordEncoder pe = new PasswordEncoder();

            if (User.Password == pe.EncryptWithByteArray(TB_Password.Password))
            {
                ((App)Application.Current).LoggedUser = User;
                signInWindow.Close();
                Overview overview = new Overview();
                overview.Show();
            }
            else
            {
                MessageBox.Show("Podano nieprawidłowe hasło.", "Błędne hasło", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }