Ejemplo n.º 1
0
        public string GetChildToken()
        {
            /*WeChildToken wct = null;
             * Application.Lock();
             * if (Application["ChildToken"] != null) {
             *  wct = Application["ChildToken"] as WeChildToken;
             *  if (wct != null && (DateTime.Now.Subtract(wct.CreateTime)).TotalSeconds < wct.Expires - 200) {
             *      return wct.ChildToken;
             *  }
             * }
             * Dictionary<string, object> dic = WeChildChatHelper.GetBabyToken();
             * wct = new WeChildToken(dic["access_token"] + "", Convert.ToInt32(dic["expires_in"] + ""));
             * Application["ChildToken"] = wct;
             * Application.UnLock();
             * return wct.ChildToken;*/
            Device_user du = new Device_user();

            return(du.SelectToken());
        }
Ejemplo n.º 2
0
        public void GetEwm()
        {
            if (Context.Session["OpenId"] != null)
            {
                string OpenId   = Context.Session["OpenId"].ToString();
                string deviceId = QrChildManager.GetChildDeviceId(OpenId);
                string token    = QrChildManager.Get_xingeToken(deviceId);

                /*Dictionary<string, string> dic = new Dictionary<string, string>();
                 * dic.Add("deviceId", deviceId);
                 * dic.Add("token", token);  xiiuagiasdasdadsdadasd
                 * Write(JsonConvert.SerializeObject(dic));*/
                Device_user du       = new Device_user();
                Byte[]      imgBytes = QrChildManager.getQrUrl(deviceId, token, du.SelectToken());
                WriteLog("GetEwm END:" + imgBytes.Length);
                Context.Response.Clear();
                Context.Response.ContentType = "image/jpg";
                Context.Response.BinaryWrite(imgBytes);
                Context.Response.End();
            }
        }
Ejemplo n.º 3
0
 public void GetToken()
 {
     HttpContext.Current.Response.Write(du.SelectToken());
     //return du.GetQrticket(product_id);
 }