示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StarNum = WEBRequest.GetFormInt("jsondata", 0);
            if (WEBRequest.GetFormString("jsondata") == "")
            {
                StarNum = WEBRequest.GetQueryInt("StarNum", 0);
            }
            returnUrl = "/Activity/HighSpeedGame/LotteryDraw.aspx?StarNum=" + StarNum;
            if (!IsPostBack)
            {
                WeiXinApi jssdk = new WeiXinApi();
                jssdk.InitApi();
                System.Collections.Hashtable hs = jssdk.getSignPackage();
                AppId     = hs["appId"].ToString();
                NonceStr  = hs["nonceStr"].ToString();
                TimeStamp = hs["timestamp"].ToInt(0);
                Signature = hs["signature"].ToString();

                Guid?userId = WebUserAuth.UserId;
                if (userId != null && userId.Value != Guid.Empty)
                {
                    IsLogin = true;
                }
                //判断答题星星数是否正确
                if (StarNum < 1 || StarNum > 3)
                {
                    Response.Redirect("/Activity/HighSpeedGame/GameIndex.aspx");
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/plain";
            string code       = WEBRequest.GetQueryString("code");
            string requestUrl = WEBRequest.GetQueryString("url");

            WeiXinApi jssdk = new WeiXinApi();

            jssdk.InitApi();
            jssdk.WXCode     = code;
            jssdk.RequestURL = requestUrl;
            System.Collections.Hashtable hs = jssdk.getSignPackage();
            WeiXinSignInfo signInfo         = new WeiXinSignInfo();

            signInfo.appid     = hs["appId"].ToString();
            signInfo.nonceStr  = hs["nonceStr"].ToString();
            signInfo.timeStamp = hs["timestamp"].ToInt(0);
            signInfo.signature = hs["signature"].ToString();
            string callBackFunc = WEBRequest.GetQueryString("callback");

            if (callBackFunc.IsNotEmpty())
            {
                string jsonStr = callBackFunc + "(" + JsonHelper.ToJson(signInfo) + ");";
                Response.Write(jsonStr);
            }
            else
            {
                string jsonStr = JsonHelper.ToJson(signInfo);
                Response.Write(jsonStr);
            }
            Response.End();
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         WeiXinApi jssdk = new WeiXinApi();
         jssdk.InitApi();
         System.Collections.Hashtable hs = jssdk.getSignPackage();
         AppId     = hs["appId"].ToString();
         NonceStr  = hs["nonceStr"].ToString();
         TimeStamp = hs["timestamp"].ToInt(0);
         Signature = hs["signature"].ToString();
     }
 }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PrizeURL = GlobalUtils.TuanDaiURL + "/member/UserPrize/Index.aspx";
            if (!IsPostBack)
            {
                WeiXinApi jssdk = new WeiXinApi();
                jssdk.InitApi();
                System.Collections.Hashtable hs = jssdk.getSignPackage();
                AppId     = hs["appId"].ToString();
                NonceStr  = hs["nonceStr"].ToString();
                TimeStamp = hs["timestamp"].ToInt(0);
                Signature = hs["signature"].ToString();

                string jsonData = WEBRequest.GetFormString("jsondata");
                if (jsonData.IsNotEmpty())
                {
                    model = JsonHelper.ToObject <GamePrizeResultInfor>(jsonData);
                }
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RightNum = Tool.WEBRequest.GetFormInt("jsondata", 0);
            if (!IsPostBack)
            {
                WeiXinApi jssdk = new WeiXinApi();
                jssdk.InitApi();
                System.Collections.Hashtable hs = jssdk.getSignPackage();
                AppId     = hs["appId"].ToString();
                NonceStr  = hs["nonceStr"].ToString();
                TimeStamp = hs["timestamp"].ToInt(0);
                Signature = hs["signature"].ToString();

                //判断答题星星数是否正确
                if (RightNum < 0 || RightNum > 3)
                {
                    Response.Redirect("/Activity/HighSpeedGame/GameIndex.aspx");
                }
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            code      = WEBRequest.GetQueryString("code");
            ExtendKey = WEBRequest.GetQueryString("ExtendKey");
            IsLogin   = WebUserAuth.IsAuthenticated ? 1 : 0;


            if (!IsPostBack)
            {
                WeiXinApi jssdk = new WeiXinApi();
                jssdk.InitApi();
                System.Collections.Hashtable hs = jssdk.getSignPackage();
                AppId     = hs["appId"].ToString();
                NonceStr  = hs["nonceStr"].ToString();
                TimeStamp = hs["timestamp"].ToInt(0);
                Signature = hs["signature"].ToString();
            }
            ThirdLoginSDK sdkApi = new ThirdLoginSDK();

            sdkApi.InitSDK(ThirdLoginSDK.ThirdLoginType.WeiXin);
            HostOpenId = sdkApi.GetCookieOpenId(code);

            if (!IsPostBack)
            {
                //判断有没帮好友做过,假如有为好友过时,则显示出自已领蛋糕的界面。 Allen 2015-07-13
                if (ExtendKey.IsNotEmpty())
                {
                    //帮好友做蛋糕
                    bool isDoCake = AjaxHandler.CheckUserHasDoCake(ExtendKey, HostOpenId);
                    if (isDoCake)
                    {
                        ExtendKey = "";//清空推广人
                    }
                }
            }
        }