/// <summary> /// 读取Cookie某个对象的Value值,返回Value值,如果对象本就不存在,则返回null /// </summary> /// <param name="CookiesName">Cookie对象名称</param> /// <returns>返回对象的Value值,返回Value值,如果对象本就不存在,则返回null</returns> public static string GetCookies(string CookiesName) { if (HttpContext.Current.Request.Cookies[CookiesName] == null) { return(null); } else { return(ZEncypt.DESDecrypt(HttpContext.Current.Request.Cookies[CookiesName].Value)); } }
/// <summary> /// 读取Cookie某个对象的Value值,返回Value值,如果对象本就不存在,则返回null /// </summary> /// <param name="CookiesName">Cookie对象名称</param> /// <param name="KeyName">键值</param> /// <returns>返回对象的Value值,返回Value值,如果对象本就不存在,则返回null</returns> public static string GetCookies(string CookiesName, string KeyName) { if (HttpContext.Current.Request.Cookies[CookiesName] == null) { return(null); } else { string strObjValue = ZEncypt.DESDecrypt(HttpContext.Current.Request.Cookies[CookiesName].Value); string strKeyName2 = KeyName + "="; if (strObjValue.IndexOf(strKeyName2) == -1) { return(null); } else { return(ZEncypt.DESDecrypt(HttpContext.Current.Request.Cookies[CookiesName][KeyName])); } } }