Example #1
0
 public static string EncryptString(SecureString input)
 {
     return(Convert.ToBase64String(ProtectedData.Protect(Encoding.Unicode.GetBytes(Protect.ToInsecureString(input)), Protect.entropy, DataProtectionScope.CurrentUser)));
 }
Example #2
0
 private void saveBtn1_Click(object sender, EventArgs e)
 {
     BiblioUpTik.Properties.Settings.Default.Template       = this.templateBox.Text;
     BiblioUpTik.Properties.Settings.Default.OnRun          = this.addBox.Checked;
     BiblioUpTik.Properties.Settings.Default.GetCover       = this.coverBox.Checked;
     BiblioUpTik.Properties.Settings.Default.GetPages       = this.pagesBox.Checked;
     BiblioUpTik.Properties.Settings.Default.GetPublisher   = this.publisherBox.Checked;
     BiblioUpTik.Properties.Settings.Default.GetDescription = this.descriptionBox.Checked;
     BiblioUpTik.Properties.Settings.Default.Width          = (int)this.widthBox.Value;
     BiblioUpTik.Properties.Settings.Default.Height         = (int)this.heightBox.Value;
     BiblioUpTik.Properties.Settings.Default.ShowCover      = this.showCoverBox.Checked;
     BiblioUpTik.Properties.Settings.Default.AnnounceURL    = Protect.EncryptString(Protect.ToSecureString(this.announceBox.Text));
     BiblioUpTik.Properties.Settings.Default.Save();
     int num = (int)MessageBox.Show("Settings Saved!");
 }