Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            string sAccount    = context.Request["Uname"].Trim();
            string sPassWord   = context.Request["Upwd"].Trim();
            string sValMessage = UserBll.RegCheck(sAccount, sPassWord);

            if (sValMessage.Length > 1)
            {
                context.Response.Write(string.Format("<script>{0};location.href='http://www.7hava.com/reg.html';</script>", sValMessage));
                return;
            }

            int iUID = UserBll.UserReg(sAccount, sPassWord);

            if (iUID < 1000)
            {
                context.Response.Write("<script>alert('注册失败,请重试!');location.href='http://www.7hava.com/reg.html';</script>");
                return;
            }
            else
            {
                string sPP = ProvideCommon.getMultiPP(iUID);
                context.Response.Redirect(string.Format("http://www.7hava.com/usercookie.aspx?un={0}&point=0&GoUrl=http://www.7hava.com&pp={1}", sAccount, sPP), true);
                return;
            }
        }
Ejemplo n.º 2
0
 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;
         }
     }
 }
Ejemplo n.º 3
0
 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");
             }
         }
     }
 }