protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod == "POST") { string username = CYRequest.GetFormString("account"); string password = CYRequest.GetFormString("pwdone"); string fromurl = CYRequest.GetFormString("url"); string sErrMsg = UserBll.LoginCheck(username, password); string sGoUrl = string.Empty; string sHost = string.Empty; if (fromurl.Length > 4) { sGoUrl = fromurl; sHost = ProvideCommon.getHost(fromurl); } else { sGoUrl = Request.UrlReferrer.ToString(); sHost = Request.UrlReferrer.Host; } if (sErrMsg.Length > 0) { Response.Write(string.Format("{0}<script>location.href='{1}'</script>", sErrMsg, sGoUrl)); return; } if (UserBll.UserAllVal(username, password)) { string sPageUrl = Request.Url.ToString(); int iUserID = UserBll.UserIDSel(username); LoginStateSet(username, iUserID, sPageUrl); //string sTypeID = string.Empty; //switch (sHost) //{ // case "www.wanyouxi123.com": // sTypeID = "20"; // break; // case "www.99wanyouxi.com": // sTypeID = "21"; // break; //} //SetUserType(sTypeID); int iPoints = GetUPoints(); string sMultiPP = ProvideCommon.getMultiPP(iUserID); string sReturnUrl = string.Format("http://{0}/usercookie.aspx?un={1}&point={2}&GoUrl={3}&pp={4}", sHost, username, iPoints.ToString(), sGoUrl, sMultiPP); Response.Redirect(sReturnUrl, true); return; } else { StringBuilder sbHtml = new StringBuilder(); sbHtml.Append("<script>alert('账号信息输入错误!');</script>"); sbHtml.AppendFormat("<script>location.href='{0}'</script>", sGoUrl); Response.Write(sbHtml.ToString()); return; } } }
protected void Page_Load(object sender, EventArgs e) { string sUrl = string.Empty; if (Request.ServerVariables["HTTP_Referer"] != null) { ClearUsersInfo(); sUrl = Request.ServerVariables["HTTP_Referer"]; string sHost = ProvideCommon.getHost(sUrl); string sToUrl = string.Format("http://{0}/usercookie.aspx?type=del&GoUrl={1}", sHost, sUrl); Response.Redirect(sToUrl, true); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.RequestType == "GET" || Request.RequestType == "POST") { string skey = "Pd23AS!2lh*2B"; string sUserName = CYRequest.GetString("username"); string sPassWord = CYRequest.GetString("password"); string sPage = Server.UrlDecode(CYRequest.GetString("page")); string sSign = CYRequest.GetString("sign"); if (sSign != "") { StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}{1}{2}", sUserName, sPassWord, skey); string sValSign = ProvideCommon.MD5(sbText.ToString()); if (sValSign == sSign) { if (UserBll.UserAllVal(sUserName, sPassWord)) { string sPageUrl = Request.Url.ToString(); int iUserID = UserBll.UserIDSel(sUserName); LoginStateSet(sUserName, iUserID, sPageUrl); if (sPage != "") { string sHost = ProvideCommon.getHost(sPage); int iUserPoint = GetUPoints(); string sPP = ProvideCommon.getMultiPP(iUserID); Response.Redirect(string.Format("http://{0}/usercookie.aspx?un={1}&point={2}&GoUrl={3}&pp={4}", sHost, sUserName, iUserPoint, sPage, sPP), true); } else { Response.Write("page is null"); } } else { Response.Write("login val err"); } } else { Response.Write("sign val err"); } } } }