public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { string sAccount = CYRequest.GetFormString("gameaccount");//充值账号 string sPid = CYRequest.GetFormString("pid"); int iPid = 0; int.TryParse(sPid, out iPid); string sUserName = PartnerUserBLL.PartnerUserNameGet(sAccount, iPid); string sPhone = CYRequest.GetFormString("gamephone"); string sPayNums = CYRequest.GetFormString("gamepaynums"); //充值金额 string sServername = CYRequest.GetFormString("gameservername"); //充值金额 StringBuilder sbText = new StringBuilder(200); sbText.AppendFormat("<form id='ptpay' name='ptpay' action='{0}' method='post'>", "PTPay.aspx"); sbText.AppendFormat("<input type='hidden' name='gameaccount' value='{0}'/>", sUserName); sbText.AppendFormat("<input type='hidden' name='gamephone' value='{0}'/>", sPhone); sbText.AppendFormat("<input type='hidden' name='gamepaynums' value='{0}'/>", sPayNums); sbText.AppendFormat("<input type='hidden' name='gameservername' value='{0}'/>", sServername); //submit按钮控件请不要含有name属性 sbText.Append("<input type='submit' value='submit' style='display:none;'></form>"); sbText.Append("<script>document.forms['ptpay'].submit();</script>"); context.Response.Write(sbText); return; } }
public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { string sAccount = CYRequest.GetFormString("bankaccount");//充值账号 string sPid = CYRequest.GetFormString("pid"); int iPid = 0; int.TryParse(sPid, out iPid); string sUserName = PartnerUserBLL.PartnerUserNameGet(sAccount, iPid); string sPhone = CYRequest.GetFormString("bankphonenum"); string sPayNums = CYRequest.GetFormString("bankpayprice");//充值金额 string bankchannel = CYRequest.GetFormString("bankchannel"); string bankname = CYRequest.GetFormString("bankname"); string cardTypeCombine = CYRequest.GetString("cardTypeCombine"); StringBuilder sbText = new StringBuilder(200); sbText.AppendFormat("<form id='bankpay' name='bankpay' action='{0}' method='post'>", "BankPay.ashx"); sbText.AppendFormat("<input type='hidden' name='bankaccount' value='{0}'/>", sUserName); sbText.AppendFormat("<input type='hidden' name='bankphonenum' value='{0}'/>", sPhone); sbText.AppendFormat("<input type='hidden' name='bankpayprice' value='{0}'/>", sPayNums); sbText.AppendFormat("<input type='hidden' name='bankchannel' value='{0}'/>", bankchannel); sbText.AppendFormat("<input type='hidden' name='bankname' value='{0}'/>", bankname); sbText.AppendFormat("<input type='hidden' name='cardTypeCombine' value='{0}'/>", cardTypeCombine); //submit按钮控件请不要含有name属性 sbText.Append("<input type='submit' value='submit' style='display:none;'></form>"); sbText.Append("<script>document.forms['bankpay'].submit();</script>"); context.Response.Write(sbText); return; } }
protected void Page_Load(object sender, EventArgs e) { string sAccount = CYRequest.GetString("account"); string sPId = CYRequest.GetString("agentid"); string sign = CYRequest.GetString("sign"); int pid = 0; int.TryParse(sPId, out pid); if (pid == 1) { string sTicket = PartnerBLL.PartnerKeySel(pid); StringBuilder sbText = new StringBuilder(50); sbText.Append(sAccount); sbText.Append(sPId); sbText.Append(sTicket); string sValSign = ProvideCommon.MD5(sbText.ToString());//md5(account + agentid + TICKEY_PAY) if (sign != sValSign) { Response.Redirect("http://www.682.com/Home/xsk"); } else { string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid); string sAccountC = string.Format("{0}:{1}", sPartnerAbbre, sAccount); int iUserID = PartnerUserBLL.PartnerUserIDSel(sAccount, pid); string sPageUrl = Request.Url.ToString(); LoginStateSet(sAccountC, iUserID, sPageUrl); } } else if (!(LoginSessionVal() || isLoginCookie())) { Response.Redirect("http://www.682.com/Home/xsk"); } }
protected void Page_Load(object sender, EventArgs e) { string sAccount = CYRequest.GetString("account"); sPId = CYRequest.GetString("agentid"); string tstamp = CYRequest.GetString("tstamp"); string sign = CYRequest.GetString("sign"); int pid; int.TryParse(sPId, out pid); TimeSpan tsNow = new TimeSpan(DateTime.Now.Ticks); long lTime = long.Parse(tstamp + "0000000"); TimeSpan tsGet = new TimeSpan(lTime); int iMinutes = tsNow.Subtract(tsGet).Minutes; string sTicket = string.Empty; if (sAccount == "" || sPId == "" || tstamp == "" || sign == "") { sErr = "null"; } else if (sAccount.Length > 20 || sAccount.Length < 6 || sAccount == "unsafe string") { sErr = "name"; } else if (pid < 1) { sErr = "pid"; } else if (iMinutes > 20) { sErr = "time"; } else { sTicket = PartnerBLL.PartnerKeySel(pid); if (sTicket == null || sTicket.Length < 1) { sErr = "ticket"; } } if (string.IsNullOrEmpty(sErr)) { StringBuilder sbText = new StringBuilder(50); sbText.Append(sAccount); sbText.Append(sPId); sbText.Append(tstamp); sbText.Append(sTicket); string sValSign = ProvideCommon.MD5(sbText.ToString());// md5(account + agentid + tstamp + TICKEY_PAY) if (sign != sValSign) { sErr = "sign"; } } if (string.IsNullOrEmpty(sErr)) { int iUserID = PartnerUserBLL.PartnerUserIDSel(sAccount, pid); if (iUserID < 1000) { sErr = "userid"; } else { sUserName = sAccount; iUserPoints = UserPointsBLL.UPointSel(iUserID); if (iUserPoints > 0) { UserPointsBLL.UPointCheck(iUserID); } string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid); if (sPartnerAbbre == null || sPartnerAbbre.Length < 1) { sErr = "partner"; } string sAccountC = string.Format("{0}:{1}", sPartnerAbbre, sAccount); string sPageUrl = Request.Url.ToString(); LoginStateSet(sAccountC, iUserID, sPageUrl); } } }
protected void Page_Load(object sender, EventArgs e) { string account = CYRequest.GetString("account"); string agentid = CYRequest.GetString("agentid"); string gameabbre = CYRequest.GetString("gameabbre"); string tstamp = CYRequest.GetString("tstamp"); if (account.Length > 20 || account.Length < 6) { Response.Write("2"); return; } TimeSpan tsNow = new TimeSpan(DateTime.Now.Ticks); long lTime = long.Parse(tstamp + "0000000"); TimeSpan tsGet = new TimeSpan(lTime); DateTime dtGet = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Add(tsGet); int iMinutes = 0; if (dtGet > DateTime.Now) { TimeSpan tsgetSpan = new TimeSpan(dtGet.Ticks); iMinutes = tsgetSpan.Subtract(tsNow).Minutes; } else { iMinutes = tsNow.Subtract(tsGet).Minutes; } if (iMinutes > 10) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); Response.Write(string.Format("3|{0}|{1}:{2}|{3}", iMinutes, DateTime.Now.ToString(), dtGet, tstamp)); return; } string sign = CYRequest.GetString("sign");//md5(account + agentid + gameabbre + tstamp + TICKEY_LOGIN) int pid = 0; int.TryParse(agentid, out pid); if (pid < 1) { Response.Write("4"); return; } string TICKEY_LOGIN = PartnerBLL.PartnerKeySel(pid); StringBuilder sbText = new StringBuilder(50); sbText.Append(account); sbText.Append(agentid); sbText.Append(gameabbre); sbText.Append(tstamp); sbText.Append(TICKEY_LOGIN); string sValSign = ProvideCommon.MD5(sbText.ToString()); if (sign == sValSign) { string sPageUrl = Request.Url.ToString(); string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid); if (sPartnerAbbre == null || sPartnerAbbre.Length < 1) { Response.Write("5"); return; } string sAccountC = string.Format("{0}:{1}", sPartnerAbbre, account); string sAccountLogin = GetAccount(); string sUserIP = ProvideCommon.GetRealIP(); int iUserID; if (sAccountC != sAccountLogin) { //1.检查帐号是否存在 iUserID = PartnerUserBLL.PartnerUserIDSel(account, pid); if (iUserID < 1000) { //2.不存在,则注册帐号 int iUID = UserBll.UserReg(sAccountC, ""); if (iUID < 1000) { Response.Write("6"); return; } else { int iRow = PartnerUserBLL.PartnerUserAdd(pid, sUserIP, iUID, account); if (iRow < 1) { Response.Write("7"); return; } } iUserID = iUID; LoginStateSet(sAccountC, iUID, sPageUrl); } else { LoginStateSet(sAccountC, iUserID, sPageUrl); } } else { iUserID = GetUserID(); if (!ValUserState(iUserID, sAccountC)) { iUserID = UserBll.UserIDSel(sAccountC); if (iUserID < 1000 || (!ValUserState(iUserID, sAccountC))) { ClearUsersInfo(); Response.Write("10"); return; } else { ClearUsersInfo(); LoginStateSet(sAccountC, iUserID, sPageUrl); } } } string sGame = GameInfoBLL.GameInfoAbbreSel(gameabbre).TrimEnd(); string sUrl = string.Empty; string sUserID = iUserID.ToString(); if (iUserID > 1000) { switch (sGame) { case "sssg": string sSource = string.Empty; string client = "web"; sUrl = sssgGame.Login(sUserID, gameabbre, sSource, client); break; case "sxd": sUrl = sxdGame.Login(sUserID, gameabbre, ""); break; case "tssg": sUrl = tssgGame.Login(sUserID, gameabbre, ""); break; case "lj": sUrl = ljGame.Login(sUserID, gameabbre); break; case "yjxy": sUrl = yjxyGame.Login(sUserID, gameabbre); break; case "mjcs": sUrl = mjcsGame.Login(sUserID, gameabbre); break; case "sq": sUrl = sqGame.Login(sUserID, gameabbre, true); break; case "hzw": sUrl = hzwGame.Login(sUserID, gameabbre); break; case "xlfc": sUrl = xlfcGame.Login(sUserID, gameabbre); break; default: Response.Write("8"); break; } } else { ClearUsersInfo(); Response.Write("11"); return; } if (sUrl != null && sUrl.Length > 5) { GameLoginBLL.GameLoginAdd(iUserID, gameabbre, sUserIP, sUrl); Response.Redirect(sUrl, true); } } else { Response.Write("9"); } }
protected void Page_Load(object sender, EventArgs e) { string account = CYRequest.GetString("account"); string agentid = CYRequest.GetString("agentid"); string tstamp = CYRequest.GetString("tstamp"); string url = CYRequest.GetString("url"); if (account.Length > 20 || account.Length < 6) { Response.Write("2"); return; } TimeSpan tsNow = new TimeSpan(DateTime.Now.Ticks); long lTime = long.Parse(tstamp + "0000000"); TimeSpan tsGet = new TimeSpan(lTime); DateTime dtGet = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Add(tsGet); int iMinutes = 0; if (dtGet > DateTime.Now) { TimeSpan tsgetSpan = new TimeSpan(dtGet.Ticks); iMinutes = tsgetSpan.Subtract(tsNow).Minutes; } else { iMinutes = tsNow.Subtract(tsGet).Minutes; } if (iMinutes > 10) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); Response.Write(string.Format("3|{0}|{1}:{2}|{3}", iMinutes, DateTime.Now.ToString(), dtGet, tstamp)); return; } string sign = CYRequest.GetString("sign");//md5(account + agentid + gameabbre + tstamp + TICKEY_LOGIN) int pid = 0; int.TryParse(agentid, out pid); if (pid < 1) { Response.Write("4"); return; } string TICKEY_LOGIN = PartnerBLL.PartnerKeySel(pid); StringBuilder sbText = new StringBuilder(50); sbText.Append(account); sbText.Append(agentid); sbText.Append(tstamp); sbText.Append(TICKEY_LOGIN); string sValSign = ProvideCommon.MD5(sbText.ToString()); if (sign == sValSign) { string sPageUrl = Request.Url.ToString(); string sPartnerAbbre = PartnerBLL.PartnerAbbreSel(pid); if (sPartnerAbbre == null || sPartnerAbbre.Length < 1) { Response.Write("5"); return; } string sAccountC = string.Format("{0}:{1}", sPartnerAbbre, account); string sAccountLogin = GetAccount(); string sUserIP = ProvideCommon.GetRealIP(); int iUserID; if (sAccountC != sAccountLogin) { //1.检查帐号是否存在 iUserID = PartnerUserBLL.PartnerUserIDSel(account, pid); if (iUserID < 1000) { //2.不存在,则注册帐号 int iUID = UserBll.UserReg(sAccountC, ""); if (iUID < 1000) { Response.Write("6"); return; } else { int iRow = PartnerUserBLL.PartnerUserAdd(pid, sUserIP, iUID, account); if (iRow < 1) { Response.Write("7"); return; } } iUserID = iUID; LoginStateSet(sAccountC, iUID, sPageUrl); } else { LoginStateSet(sAccountC, iUserID, sPageUrl); } } else { iUserID = GetUserID(); if (!ValUserState(iUserID, sAccountC)) { iUserID = UserBll.UserIDSel(sAccountC); if (iUserID < 1000 || (!ValUserState(iUserID, sAccountC))) { ClearUsersInfo(); Response.Write("10"); return; } else { ClearUsersInfo(); LoginStateSet(sAccountC, iUserID, sPageUrl); } } } if (url.Length > 5) { string sUrl = Server.UrlDecode(url); Response.Redirect(sUrl, true); } } else { Response.Write("9"); } }