Пример #1
0
        public static void WriteCode(string val, string cookieName, string cookieKey)
        {
            string   ip   = HttpContext.Current.Request.UserHostAddress;
            DateTime time = DateTime.Now.AddMinutes(2);
            string   valx = string.Format("{0}_{1}_{2}_{3}",
                                          SafeSecurity.MD5Encrypt(time.Ticks.ToString()) + time.Ticks, ip, val, time);
            string des = SafeSecurity.EncryptDES(valx, DesKey);

            CookieHelper.SetCookie(cookieName, cookieKey, des);
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cookiename"></param>
 /// <param name="cookievalue"></param>
 /// <param name="domainname"></param>
 /// <param name="hour"></param>
 /// <param name="minute"></param>
 /// <returns></returns>
 public static bool SetCookie3Des(string cookiename, string cookievalue, string domainname, int hour, int minute)
 {
     cookievalue = SafeSecurity.EncryptDES(cookievalue, Des3Key);
     return(SetCookie(cookiename, cookievalue, domainname, hour, minute));
 }