Ejemplo n.º 1
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            SimpleAES crypt = new SimpleAES();

            String username = crypt.EncryptToString(UserNametextBox.Text);
            String password = crypt.EncryptToString(PasswordTextBox.Text);

            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings["UserName"].Value = username;
            config.AppSettings.Settings["Password"].Value = password;
            config.Save(ConfigurationSaveMode.Modified);

            ConfigurationManager.RefreshSection("appSettings");

            this.Close();
        }