コード例 #1
0
ファイル: LCookie.cs プロジェクト: ljsheng1984/baijia
        /// <summary>
        /// 获取管理员的信息
        /// </summary>
        /// <returns></returns>
        public static string Getljsheng(string field)
        {
            HttpCookie ck   = HttpContext.Current.Request.Cookies["LJSheng"];
            JObject    json = JsonConvert.DeserializeObject(DESRSA.DESDeljsheng(StringTranscoding.UnEscape(ck.Value.ToString()))) as JObject;

            return(json[field].ToString());
        }
コード例 #2
0
ファイル: LCookie.cs プロジェクト: ljsheng1984/baijia
        /// <summary>
        /// 获取用户登录Cookie的商家GID
        /// </summary>
        /// <returns></returns>
        public static Guid GetShopGid()
        {
            HttpCookie ck = HttpContext.Current.Request.Cookies["shop"];

            if (ck != null)
            {
                JObject json = JsonConvert.DeserializeObject(DESRSA.DESDeljsheng(StringTranscoding.UnEscape(ck.Value.ToString()))) as JObject;
                return(Guid.Parse(json["Gid"].ToString()));
            }
            else
            {
                return(Guid.Parse("00000000-0000-0000-0000-000000000000"));
            }
        }
コード例 #3
0
        /// <summary>
        /// 获取商家登录Cookie的GID
        /// <param name="lx">1=用户GID 2=商家GID</param>
        /// </summary>
        /// <returns></returns>
        public static Guid GetShop(int lx)
        {
            HttpCookie ck   = HttpContext.Current.Request.Cookies["shop"];
            JObject    json = JsonConvert.DeserializeObject(DESRSA.DESDeljsheng(StringTranscoding.UnEscape(ck.Value.ToString()))) as JObject;

            if (lx == 1)
            {
                return(Guid.Parse(json["gid"].ToString()));
            }
            else
            {
                return(Guid.Parse(json["shopgid"].ToString()));
            }
        }