Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sTranID = CYRequest.GetQueryString("TranID");

            iPayPoints = TransPBLL.TranPSelPointByID(sTranID);
            int iUserID = TransPBLL.TranPSelUserIDByID(sTranID);

            iUserPoints = UserPointsBLL.UPointAllSel(iUserID);
            int iLUserID = GetUserID();

            if (iLUserID > 999 && (iUserID == iLUserID))
            {
                SetPoints(iUserPoints);
            }
            string sFromHost = GetFromHost();

            if (sFromHost.Length > 5)
            {
                string sQueryString       = string.Format("{0}|{1}|{2}", sTranID, iPayPoints, iUserPoints);
                string sEncodeQueryString = Server.UrlEncode(sQueryString);
                string sGoUrl             = string.Format("http://{0}/PayPSucc.html?{1}", sFromHost, sEncodeQueryString);
                Response.Redirect(sGoUrl, true);
                return;
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sErr = CYRequest.GetQueryString("err");

            switch (sErr)
            {
            case "null":
            case "account":
            case "pid":
                sErrText = "参数有问题!";
                break;

            case "time":
                sErrText = "时间超出!请从新操作!";
                break;

            case "ticket":
                sErrText = "sign验证失败!";
                break;

            case "userid":
                sErrText = "还没登陆游戏,请登陆游戏先!";
                break;

            case "partner":
                sErrText = "合作商不合法!";
                break;

            default:
                sErrText = "请从新登陆!";
                break;
            }
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         string sAccount = CYRequest.GetQueryString("un");
         if (sAccount.Length > 3)
         {
             setaccount(sAccount);
         }
     }
 }
Пример #4
0
        public void ProcessRequest(HttpContext context)
        {
            //获取Authorization Code
            string usercancel = CYRequest.GetQueryString("usercancel", false);

            if (usercancel.Length == 0)
            {
                //通过Authorization Code获取Access Token
                string code          = CYRequest.GetQueryString("code", false);
                string grant_type    = "authorization_code";
                string client_id     = "100225329";
                string client_secret = "a7a94f5cf02c8b46bc40f3597f535e46";
                string state         = CYRequest.GetQueryString("state", false);
                string md5State      = ProvideCommon.MD5(state);
                string redirect_uri  = context.Server.UrlEncode(string.Format("http://game.dao50.com/Services/qqCallBack.ashx?ms={0}", md5State));
                string sQQTokenUrl   = string.Format("https://graph.qq.com/oauth2.0/token?grant_type={0}&client_id={1}&redirect_uri={2}&code={3}&client_secret={4}",
                                                     grant_type, client_id, redirect_uri, code, client_secret);
                string   sTokenReturn      = ProvideCommon.GetPageInfo(sQQTokenUrl);
                string[] sTokenReturnArray = sTokenReturn.Split('&');
                Dictionary <string, string> dTokenReturn = new Dictionary <string, string>();
                foreach (string i in sTokenReturnArray)
                {
                    string[] sParams = i.Split('=');
                    if (sParams.Length == 2)
                    {
                        dTokenReturn.Add(sParams[0], sParams[1]);
                    }
                }
                string sAccessToken = dTokenReturn["access_token"].ToString();//Access_Token的有效期默认是3个月
                //获取用户OpenID
                string sQQOpenIDUrl  = string.Format("https://graph.qq.com/oauth2.0/me?access_token={0}", sAccessToken);
                string sOpenIDReturn = ProvideCommon.GetPageInfo(sQQOpenIDUrl).Trim();
                string sOpenID       = ProvideCommon.getJsonValueC("openid", sOpenIDReturn);
                //context.Response.Write(string.Format("Retrun:{0};OpenID:{1}",sOpenIDReturn,sOpenID));
                //判断openid是否存在
                int iUserID = QQUserBLL.QQUserUseridSelByOpenID(sOpenID);
                if (iUserID < 1000)
                {
                    //不存在则注册
                }
                else
                {
                    //存在则新用户登陆
                }
            }
            else
            {
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sErr = CYRequest.GetQueryString("err");

            switch (sErr)
            {
            case "101":
                sErrText = "充值订单提交失败";
                break;

            case "102":
                sErrText = "游戏兑换失败!兑换武林币成功,请使用武林币兑换游戏";
                break;

            case "103":
                sErrText = "无返回参数";
                break;

            case "104":
                sErrText = "认证签名失败";
                break;

            case "105":
                sErrText = "支付失败";
                break;

            case "110":
                sErrText = "正在充值中,请稍等查看余额";
                break;

            case "111":
                sErrText = "交易没有成功!如有问题请与客服联系!";
                break;

            case "204":
                sErrText = "充值金额有误!";
                break;
            }
            string sFromHost = GetFromHost();

            if (sFromHost.Length > 5)
            {
                string sGoUrl = string.Format("http://{0}/PayPErr.html?{1}", sFromHost, sErr);
                Response.Redirect(sGoUrl, true);
                return;
            }
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         int    iUserID    = GetUserID();
         string sGameAbbre = CYRequest.GetQueryString("gn");
         if (iUserID > 999 & sGameAbbre.Length > 2 && sGameAbbre.IndexOf("by") == 0)
         {
             string sGameUrl = byGame.Login(iUserID.ToString(), sGameAbbre);
             Response.Redirect(sGameUrl, true);
         }
         sAccount = GetAccount();
     }
     else
     {
         Server.Transfer("byLogin.aspx");
     }
 }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sErr = CYRequest.GetQueryString("err");

            switch (sErr)
            {
            case "201":
                sErrText = "充值游戏账号不存在";
                break;

            case "202":
                sErrText = "充值的游戏未创建角色";
                break;

            case "203":
                sErrText = "网络繁忙!武林币获取失败";
                break;

            case "204":
                sErrText = "账号余额为0 ";
                break;

            case "205":
                sErrText = "角色名错误";
                break;

            case "206":
                sErrText = "游戏充值失败,如有问题请联系客服";
                break;

            default:
                sErrText = "";
                break;
            }
            string sFromHost = GetFromHost();

            if (sFromHost.Length > 5)
            {
                string sGoUrl = string.Format("http://{0}/PayGErr.html?{1}", sFromHost, sErr);
                Response.Redirect(sGoUrl, true);
                return;
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sUID  = CYRequest.GetQueryString("uid").Trim();
            string sType = string.Empty;

            if (sUID.Length > 3)
            {
                string sHava7UID = "18967189|18967207|18967219|18967230|18967236|18967241";
                if (sHava7UID.IndexOf(sUID) > -1)
                {
                    Response.Redirect("http://www.7hava.com/");
                    return;
                }
                sType = GetUserType(sUID);
            }
            string sGoUrl       = string.Empty;
            string sQueryString = Request.Url.Query;

            switch (sType)
            {
            case "2":
                sGoUrl = string.Format("http://game.niuzei.com/pay/{0}", sQueryString);
                break;

            case "20":
                sGoUrl = string.Format("http://www.wanyouxi123.com/pay.html{0}", sQueryString);
                break;

            case "21":
                sGoUrl = string.Format("http://www.99wanyouxi.com/pay.html{0}", sQueryString);
                break;

            case "22":
                sGoUrl = string.Format("http://www.50shouyou.com/pay.html{0}", sQueryString);
                break;

            case "23":
                sGoUrl = string.Format("http://www.50dao.com/pay.html{0}", sQueryString);
                break;

            case "24":
                sGoUrl = string.Format("http://www.niu50.com/pay.html{0}", sQueryString);
                break;

            case "25":
                sGoUrl = string.Format("http://www.99nbwan.com/pay.html{0}", sQueryString);
                break;

            case "26":
                sGoUrl = string.Format("http://www.97nbwan.com/pay.html{0}", sQueryString);
                break;
            }
            if (sGoUrl.Length > 5)
            {
                Response.Redirect(sGoUrl, true);
                return;
            }
            if (LoginSessionVal() || isLoginCookie())
            {
                int iUserID = GetUserID();
                sUserName   = GetAccount();
                iUserPoints = UserPointsBLL.UPointAllSel(iUserID);
                if (iUserPoints > 0)
                {
                    UserPointsBLL.UPointCheck(iUserID);
                }
                SetPoints(iUserPoints);
                sIsLogin = "******";
            }
            else
            {
                sIsLogin = "******";
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取Authorization Code
            string usercancel = CYRequest.GetQueryString("usercancel", false);

            if (usercancel.Length == 0)
            {
                //通过Authorization Code获取Access Token
                string code         = CYRequest.GetQueryString("code", false);
                string state        = CYRequest.GetQueryString("state", false);
                string sMD5State    = CYRequest.GetQueryString("ms", false);
                string sMD5StateVal = ProvideCommon.MD5(state);
                if (sMD5State == sMD5StateVal)
                {
                    string redirect_uri = Server.UrlEncode(string.Format("http://game.dao50.com/Services/qqCallBack.aspx?ms={0}", sMD5StateVal));
                    string sAccessToken = QQLogin.GetAccessToken(redirect_uri, code);
                    string sOpenID      = QQLogin.GetOpenID(sAccessToken);
                    //判断openid是否存在
                    int iUserID = QQUserBLL.QQUserUseridSelByOpenID(sOpenID);
                    if (iUserID < 1000)
                    {
                        string sNickName = QQLogin.GetNickName(sAccessToken, sOpenID);
                        string sAccount  = QQLogin.GetAccount(sNickName);
                        int    iType     = 3;
                        int    iUID      = UserBll.UserReg(sAccount, sOpenID, iType);
                        if (-1 == iUID)
                        {
                            Response.Write("<script>alert('注册失败,请重试!location.href='http://www.dao50.com/';')</script>");
                            return;
                        }
                        else if (iUID > 999)
                        {
                            UserInfo uiObject = new UserInfo();
                            uiObject.Credennum = "";
                            uiObject.Answer    = "";
                            uiObject.Email     = "";
                            uiObject.Name      = sNickName;
                            uiObject.question  = "";
                            uiObject.regip     = ProvideCommon.GetRealIP();
                            uiObject.uid       = iUID;
                            UserInfoBLL.UserInfoAdd(uiObject);
                            string sPageUrl = Request.Url.ToString();
                            QQUserBLL.QQUserAdd(iUID, sOpenID, sPageUrl);
                            LoginStateSet(sAccount, iUID, sPageUrl);
                            string sWUrl   = WebConfig.BaseConfig.sWUrl;
                            string sWWWUrl = string.Format("{0}/{1}?un={2}", sWUrl, "usercookie.aspx", sAccount);
                            string sKey    = ConfigurationManager.AppSettings["UserValKey"].ToString();
                            string sBBSUrl = DiscuzUserI.BBSLogin(sAccount, sOpenID, sKey);
                            string sJSUrl  = string.Format("<script src='{0}'></script><script src='{1}'></script>", sBBSUrl, sWWWUrl);
                            Response.Write(string.Format("{0}<script>alert('注册成功!');location.href='http://www.dao50.com/';</script>", sJSUrl));
                            return;
                        }
                    }
                    else
                    {
                        string sAccount = UserBll.AccountSel(iUserID).Trim();
                        int    iPoints  = UserPointsBLL.UPointAllSel(iUserID);
                        string sKey     = ConfigurationManager.AppSettings["UserValKey"].ToString();
                        string sUrl     = DiscuzUserI.BBSLogin(sAccount, sOpenID, sKey);
                        string sPageUrl = Request.Url.ToString();
                        LoginStateSet(sAccount, iUserID, sPageUrl);
                        string sCUrl  = WebConfig.BaseConfig.sWUrl;
                        string sJSUrl = string.Format("{0}/{1}?un={2}", sCUrl, "usercookie.aspx", sAccount);
                        Response.Write(string.Format("<script src='{0}'></script><script src='{1}'></script><script>location.href='{2}'</script>",
                                                     sUrl, sJSUrl, sCUrl));
                    }
                }
                else
                {
                    Response.Write("state err");
                }
            }
            else
            {
                Response.Write("<script>alert('登陆失败!location.href='http://www.dao50.com/';')</script>");
                return;
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sTranID    = CYRequest.GetQueryString("TranID");
            int    iPayUserID = TransGBLL.TransSelGUserIDByTID(sTranID);

            sPayAccount = UserBll.AccountSel(iPayUserID).Trim();
            iGamePoints = TransGBLL.TransGamePointsSelByTID(sTranID);
            string sAbbre  = CYRequest.GetQueryString("gn");
            string sType   = CYRequest.GetQueryString("type");
            string sGAbbre = GameInfoBLL.GameInfoAbbreSel(sAbbre).Trim();

            switch (sGAbbre)
            {
            case "sssg":
                sGameName = "盛世三国";
                sGameM    = "银(注:1000银=1锭)";
                break;

            case "sxd":
                sGameName = "神仙道";
                sGameM    = "元宝";
                break;

            case "lj":
                sGameName = "龙将";
                sGameM    = "金币";
                break;

            case "yjxy":
                sGameName = "一剑轩辕";
                sGameM    = "元宝";
                break;

            case "dxz":
                sGameName = "大侠传";
                sGameM    = "黄金";
                break;

            case "djj":
                sGameName = "大将军";
                sGameM    = "黄金";
                break;

            case "txj":
                sGameName = "天行剑";
                sGameM    = "元宝";
                break;

            case "sjsg":
                sGameName = "神将三国";
                sGameM    = "元宝";
                break;

            case "tzcq":
                sGameName = "天尊传奇";
                sGameM    = "元宝";
                break;

            case "zsg":
                sGameName = "战三国";
                sGameM    = "元宝";
                break;

            case "wssg":
                sGameName = "无双三国";
                sGameM    = "元宝";
                break;

            case "by":
                sGameName = "霸域";
                sGameM    = "元宝";
                break;

            case "mxqy":
                sGameName = "冒险契约";
                sGameM    = "金币";
                break;

            case "swjt":
                sGameName = "神武九天";
                sGameM    = "元宝";
                break;

            case "gcld":
                sGameName = "攻城掠地";
                sGameM    = "金币";
                break;

            case "tjz":
                sGameName = "天劫传";
                sGameM    = "元宝";
                break;

            case "khbd":
                sGameName = "葵花宝典";
                sGameM    = "元宝";
                break;

            case "sglj":
                sGameName = "三国论剑";
                sGameM    = "通宝";
                break;

            case "hyjft":
                sGameName = "火影疾风坛";
                sGameM    = "金币";
                break;

            case "llsg":
                sGameName = "龙狼三国";
                sGameM    = "黄金";
                break;

            case "nslm":
                sGameName = "女神联盟";
                sGameM    = "钻石";
                break;

            case "rxzt":
                sGameName = "热血遮天";
                sGameM    = "元宝";
                break;

            case "ahxy":
                sGameName = "暗黑西游";
                sGameM    = "元宝";
                break;

            case "mhxy":
                sGameName = "梦回轩辕";
                sGameM    = "元宝";
                break;

            case "sxj":
                sGameName = "神仙劫";
                sGameM    = "元宝";
                break;

            case "zwj":
                sGameName = "最无极";
                sGameM    = "元宝";
                break;

            case "qxz":
                sGameName = "群侠传";
                sGameM    = "元宝";
                break;

            case "qszg":
                sGameName = "骑士战歌";
                sGameM    = "金币";
                break;

            case "wwsg":
                sGameName = "威武三国";
                sGameM    = "元宝";
                break;

            case "dntg":
                sGameName = "大闹天宫";
                sGameM    = "元宝";
                break;

            case "ahxx":
                sGameName = "暗黑修仙";
                sGameM    = "元宝";
                break;

            case "jjp":
                sGameName = "将军破";
                sGameM    = "元宝";
                break;

            case "sgyjz":
                sGameName = "三国英杰传";
                sGameM    = "金币";
                break;

            case "dtgzt":
                sGameName = "太古遮天";
                sGameM    = "元宝";
                break;

            case "dtgzter":
                sGameName = "太古遮天2";
                sGameM    = "元宝";
                break;
            }
            if ("q" == sType)
            {
                sAccount    = sPayAccount;
                iUserPoints = UserPointsBLL.UPointAllSel(iPayUserID);
            }
            else
            {
                int iUserID = GetUserID();
                if (iUserID > 999)
                {
                    iUserPoints = UserPointsBLL.UPointAllSel(iUserID);
                    sAccount    = GetAccount();
                }
            }
            SetPoints(iUserPoints);
            string sFromHost = GetFromHost();

            if (sFromHost.Length > 5)
            {
                string sServerNum         = sAbbre.Replace(sGAbbre, "");
                string sQueryString       = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", sTranID, sGameName, sServerNum, sPayAccount, sAccount, iGamePoints, iUserPoints, sGameM);
                string sEncodeQueryString = Server.UrlEncode(sQueryString);
                string sGoUrl             = string.Format("http://{0}/PayGSucc.html?{1}", sFromHost, sEncodeQueryString);
                Response.Redirect(sGoUrl, true);
                return;
            }
        }