Exemple #1
0
        /// <summary>
        ///     Get the encrypted password from the preferences and decrypt it
        /// </summary>
        /// <returns>A decrypted password</returns>
        public static string GetPassword()
        {
            var encryptedPassword = PreferenceManager.GetPreference(PrefConstants.Password,
                                                                    "arif".Encrypt(KeyConstants.Key));
            var decryptedPassword = encryptedPassword.Decrypt(KeyConstants.Key);

            return(decryptedPassword);
        }
 private void FormPreference_Load(object sender, EventArgs e)
 {
     prefer = preferManager.GetPreference();
     if (prefer == null)
     {
         // 缺省设置
         SetDefaultInfo();
     }
     else
     {
         // 根据配置项设置
         SetInfoByPrefer();
     }
 }