示例#1
0
        public static void InitCookie(string uin)
        {
            WxSerializable s           = new WxSerializable(uin, EnumContainer.SerializType.cookie);
            var            cookies_dic = (Dictionary <string, CookieContainer>)s.DeSerializable();

            HttpService.CookiesContainerDic = cookies_dic;
        }
示例#2
0
        public static void PassTicket(string uin, PassTicketEntity entity)
        {
            //序列化登录passticket
            WxSerializable s = new WxSerializable(uin, EnumContainer.SerializType.pass_ticket);

            s.Serializable(entity);
            if (_passticket_dic.ContainsKey(uin))
            {
                _passticket_dic.Remove(uin);
            }
            _passticket_dic.Add(uin, entity);
        }
示例#3
0
 public static PassTicketEntity GetPassTicket(string uin)
 {
     if (string.IsNullOrEmpty(uin))
     {
         uin = string.Empty;
     }
     if (_passticket_dic.ContainsKey(uin))
     {
         return(_passticket_dic[uin]);
     }
     else
     {
         WxSerializable s = new WxSerializable(uin, EnumContainer.SerializType.pass_ticket);
         //if (_passticket_dic.ContainsKey(uin))
         //    _passticket_dic.Remove(uin);
         ////先判断下键值是否存在要不卡死头像只能显示一个用户的
         //if (uin=="0")
         //{
         //    return null;
         //}
         //if (!_passticket_dic.ContainsKey("1"))
         //{
         //    _passticket_dic.Add(uin, (PassTicketEntity)s.DeSerializable());
         //}
         //return (PassTicketEntity)s.DeSerializable();
         try
         {
             if (_passticket_dic.ContainsKey(uin))
             {
                 _passticket_dic.Remove(uin);
             }
             _passticket_dic.Remove(uin);
             return((PassTicketEntity)s.DeSerializable());
         }
         catch (Exception ex)
         {
             Tools.Tools.WriteLog(ex.ToString());
             return(null);
         }
     }
 }