Exemplo n.º 1
0
        /// <summary>
        /// 获取使用TripleDES解密后的Cookie
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static String GetTripleDESEncryptedCookieValue(String key)
        {
            key = EncryptString.EncryptTripleDES(key);
            String valueString = GetCookieValue(key);

            valueString = EncryptString.DecryptTripleDES(valueString);
            return(valueString);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 设置使用TripleDES加密后的Cookie,并设置Cookie的有效时间
 /// </summary>
 /// <param name="key"></param>
 /// <param name="valueString"></param>
 /// <param name="expires"></param>
 public static void SetTripleDESEncryptedCookie(String key, String valueString, DateTime expires)
 {
     key         = EncryptString.EncryptTripleDES(key);
     valueString = EncryptString.EncryptTripleDES(valueString);
     SetCookie(key, valueString, expires);
 }