Esempio n. 1
0
        public static bool CheckHash(string originalKey, string value, string hashSuffix)
        {
            if (!StringUtils.HasText(value))
            {
                return(true);
            }
            string @string = UserPrefs.GetString(UserPrefs.CreateHashKey(originalKey), null);
            string a       = UserPrefs.CreateHashValue(value, hashSuffix);

            return(a == @string);
        }
Esempio n. 2
0
        public static T GetXml <T>(string key, T defaultT)
        {
            if (UserPrefs.HasKey(key))
            {
                string en = UserPrefs.GetString(key, "");
                if (en == "")
                {
                    return(defaultT);
                }

                string        de = EncryptUtils.Base64Decrypt(en);
                XmlSerializer ss = new XmlSerializer(typeof(T));
                StringReader  sr = new StringReader(de);
                return((T)ss.Deserialize(sr));
            }
            return(defaultT);
        }