コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    userid    = WebBase.GetQueryStringInt32("u", 0);
            int    manageid  = WebBase.GetQueryStringInt32("m", 0);
            string sessionId = WebBase.GetQueryStringString("key", "");
            string sign      = WebBase.GetQueryStringString("sign", "");

            string plain = string.Format("{0}|{1}|{2}{3}", userid, manageid,
                                         sessionId, viviapi.BLL.Sys.Constant.ManageGOTOUserAdminKey);


            string sign2 = viviLib.Security.Cryptography.MD5(plain);

            if (sign == sign2)
            {
                int manageid2 = viviapi.BLL.ManageFactory.GetIdBySession(sessionId);
                if (manageid == manageid2)
                {
                    HttpContext.Current.Session[viviapi.BLL.Sys.Constant.ManageGOTOUserAdminKey] = userid;

                    Response.Redirect("/usermodule/account/index.aspx");
                }
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool success = false;

            string bankcode = "";
            int    suppid   = 0;

            try
            {
                userid   = Request.QueryString["userid"];
                suppid   = WebBase.GetQueryStringInt32("suppid", 0);
                orderid  = Request.QueryString["orderid"];
                orderAmt = Request.QueryString["orderAmt"];
                bankcode = Request.QueryString["bankcode"];
                string time = Request.QueryString["time"];
                string sign = Request.QueryString["sign"];

                //hforderid.Value = orderid;

                #region

                if (!string.IsNullOrEmpty(userid) && !string.IsNullOrEmpty(time))
                {
                    int intUserid = 0;

                    if (int.TryParse(userid, out intUserid))
                    {
                        var userinfo = viviapi.BLL.User.Factory.GetCacheUserBaseInfo(intUserid);

                        if (userinfo != null)
                        {
                            string thisSign =
                                string.Format(
                                    "userid={0}&suppid={1}&orderid={2}&orderAmt={3}&bankcode={4}&time={5}{6}"
                                    , userid
                                    , suppid
                                    , orderid
                                    , orderAmt
                                    , bankcode
                                    , time
                                    , userinfo.APIKey);

                            thisSign = viviLib.Security.Cryptography.MD5(thisSign);

                            if (thisSign == sign)
                            {
                                success = true;
                            }
                        }
                    }
                }

                #endregion
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(ex);
                Response.Write("error");
                Response.End();
            }

            if (success)
            {
                Getqrcode_img_url(suppid, orderid, decimal.Parse(orderAmt), bankcode);
            }
        }