示例#1
0
 private string EncryptText(string value)
 {
     if (EncryptMode == EncryptModeOption.AES)
     {
         value = Encrypt.EncryptText(value);
     }
     else if (EncryptMode == EncryptModeOption.UrlEncode)
     {
         value = Uri.EscapeDataString(value);
     }
     return(value);
 }
示例#2
0
        private bool InitPassword()
        {
            PasswordForm passwordForm = new PasswordForm();

            if (passwordForm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
            {
                return(false);
            }

            string password = passwordForm.Password;

            EncryptManager manager = new EncryptManager();

            manager.EncryptKey = System.Environment.UserName;
            string password2 = manager.EncryptText(password);

            Properties.Settings.Default.EncryptKey = password2;
            Properties.Settings.Default.Save();
            return(true);
        }