예제 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            AccountsProtect protect = new AccountsProtect();

            protect.UserID      = Fetch.GetUserCookie().UserID;
            protect.InsurePass  = TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtNewPass));
            protect.Response1   = CtrlHelper.GetText(txtResponse1);
            protect.Response2   = CtrlHelper.GetText(txtResponse2);
            protect.Response3   = CtrlHelper.GetText(txtResponse3);
            protect.LastLogonIP = GameRequest.GetUserIP();

            Message umsg = accountsFacade.ResetInsurePasswd(protect);

            if (umsg.Success)
            {
                this.form1.Visible = false;

                this.divRight.Visible   = true;
                this.divRight.InnerHtml = "<div class=\"Uright\">重置银行密码成功!</div>";
            }
            else
            {
                Show(umsg.Content);
                this.txtResponse1.Text = "";
                this.txtResponse2.Text = "";
                this.txtResponse3.Text = "";
            }
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strAccounts = context.Request.Form["txtAccounts"] ?? string.Empty;
            string serialID    = context.Request.Form["txtSerialID"] ?? string.Empty;
            string password    = context.Request.Form["txtPassword"] ?? string.Empty;

            if (string.IsNullOrEmpty(strAccounts) || string.IsNullOrEmpty(serialID) || string.IsNullOrEmpty(password))
            {
                context.Response.Write("-1");
            }
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID   = serialID;
            detailInfo.OperUserID = 0;
            detailInfo.Accounts   = strAccounts;
            detailInfo.ShareID    = 1;          //实卡充值服务标识
            detailInfo.IPAddress  = Utility.UserIP;
            #region 充值
            Message umsg = treasureFacade.FilledLivcard(detailInfo, TextEncrypt.EncryptPassword(password));
            if (umsg.Success)
            {
                context.Response.Write("0");
            }
            else
            {
                context.Response.Write(umsg.Content);
            }
        }
예제 #3
0
        public static string PementQuery(string merchant_order)
        {
            string url      = ApplicationSettings.Get("url_san") + "/Pay/PementQuery.aspx";
            string value    = ApplicationSettings.Get("partner_san");
            string password = ApplicationSettings.Get("key_san");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["mer_id"]     = value;
            dictionary["order_id"]   = merchant_order;
            dictionary["time_stamp"] = DateTime.Now.ToString("yyyyMMddHHmmss");
            string text = "";

            foreach (KeyValuePair <string, string> item in dictionary)
            {
                string text2 = text;
                text = text2 + item.Key + "=" + item.Value + "&";
            }
            password = TextEncrypt.EncryptPassword(password).ToLower();
            string text4 = dictionary["sign"] = TextEncrypt.EncryptPassword(text + "key=" + password).ToLower();
            string param = HttpHelper.GetParam(dictionary);
            string json  = HttpHelper.HttpRequest(url, param);
            Dictionary <string, string> dictionary2 = JsonHelper.DeserializeJsonToObject <Dictionary <string, string> >(json);

            if (dictionary2.ContainsKey("status_code"))
            {
                if (dictionary2["status_code"] == "0")
                {
                    return("SUCCESS");
                }
                return(dictionary2["status_msg"].ToString());
            }
            return("查询订单失败");
        }
예제 #4
0
        /// <summary>
        /// 微信接口
        /// </summary>
        /// <param name="url"></param>
        /// <param name="postData"></param>
        /// <param name="requestmethod"></param>
        /// <returns></returns>
        public static string PalmWXAPI(string url, Dictionary <string, string> postData, string requestmethod)
        {
            string str           = "";
            string host_wx       = System.Configuration.ConfigurationManager.AppSettings["Call_WXApiHost"];                           //WX的API接口链接
            string api_code      = System.Configuration.ConfigurationManager.AppSettings["Call_WXApiCode"];                           //调用FAQ接口所需的Code
            string api_key       = System.Configuration.ConfigurationManager.AppSettings["Call_WXApiKey"];                            //调用FAQ接口所需的Key
            string wxappid       = System.Configuration.ConfigurationManager.AppSettings["PalmmsgBIAppID"];                           //调用FAQ接口所需的Key
            string api_timestamp = GetTimeStamp();                                                                                    //调用FAQ接口所需的时间戳
            string api_sign      = TextEncrypt.MD5Encrypt32(api_code + api_key + api_timestamp, System.Text.Encoding.UTF8).ToLower(); //调用FAQ接口所需的签名

            url = host_wx + url;
            try
            {
                postData.Add("api_code", api_code);
                postData.Add("api_timestamp", api_timestamp);
                postData.Add("api_sign", api_sign);
                //如果外面没有传wxappid进来,则使用web.config的配置中的wxappid
                if (!postData.ContainsKey("wxappid"))
                {
                    postData.Add("wxappid", wxappid);
                }
                str = HttpRequests.HttpRequestString(url, postData, requestmethod);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(str);
        }
예제 #5
0
        /// <summary>
        /// 检查API接口授权
        /// </summary>
        void CheckApiAuth(ref ApiResult apiresult)
        {
            string r_ApiCode   = !string.IsNullOrEmpty(Request["api_code"]) ? Request["api_code"].Trim() : "";
            string r_TimeStamp = !string.IsNullOrEmpty(Request["api_timestamp"]) ? Request["api_timestamp"].Trim() : ""; //时间戳
            string r_Sign      = !string.IsNullOrEmpty(Request["api_sign"]) ? Request["api_sign"].Trim() : "";           //API签名

            if (string.IsNullOrEmpty(r_ApiCode))
            {
                apiresult.errcode = -1;
                apiresult.errmsg  = "无ApiCode";
                return;
            }
            if (r_ApiCode.ToLower() != ApiCode.ToLower())
            {
                apiresult.errcode = -1;
                apiresult.errmsg  = "ApiCode未授权";
                return;
            }
            //判断时间戳是否在容差范围之内
            try
            {
                double timestamp = 0d;
                bool   success   = true;
                success = double.TryParse(r_TimeStamp, out timestamp);
                if (!success)
                {
                    apiresult.errcode = -1;
                    apiresult.errmsg  = "Api时间戳错误";
                    return;
                }
                DateTime now      = DateTime.Now;
                DateTime newnow   = TimestampToDatetime(timestamp);
                double   timediff = (now - newnow).TotalSeconds;
                if (timediff > ApiTimeTolerance || ApiTimeTolerance < (-ApiTimeTolerance))
                {
                    apiresult.errcode = -1;
                    apiresult.errmsg  = "Api时间戳超出范围";
                    return;
                }
            }
            catch (Exception ex)
            {
                apiresult.errcode = -1;
                apiresult.errmsg  = "Api时间戳错误";
                LogWriter.WriteLog(ex);
                return;
            }
            if (string.IsNullOrEmpty(r_Sign))
            {
                apiresult.errcode = -1;
                apiresult.errmsg  = "无Api签名";
                return;
            }
            if (r_Sign.ToLower() != TextEncrypt.MD5Encrypt32(ApiCode + ApiKey + r_TimeStamp, System.Text.Encoding.UTF8).ToLower())
            {
                apiresult.errcode = -1;
                apiresult.errmsg  = "Api签名错误";
                return;
            }
        }
예제 #6
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            GameMatchUserInfo userInfo = new GameMatchUserInfo( );

            userInfo.Accounts      = CtrlHelper.GetText(txtAccounts);
            userInfo.ClientIP      = GameRequest.GetUserIP( );
            userInfo.CollectDate   = DateTime.Now;
            userInfo.Compellation  = CtrlHelper.GetText(txtCompellation);
            userInfo.DwellingPlace = CtrlHelper.GetText(txtDwellingPlace);
            userInfo.EMail         = CtrlHelper.GetText(txtEMail);
            userInfo.Gender        = Convert.ToByte(rdoFemale.Checked == true ? 0 : 1);
            userInfo.MatchID       = XID;
            userInfo.MobilePhone   = CtrlHelper.GetText(txtMobilePhone);
            userInfo.PassportID    = CtrlHelper.GetText(txtPassportID);
            userInfo.PostalCode    = CtrlHelper.GetText(txtPostalCode);
            userInfo.QQ            = CtrlHelper.GetText(txtQQ);

            Message umsg = webFacade.AddGameMatch(userInfo, TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtPwd)));

            if (umsg.Success)
            {
                ShowAndRedirect("报名成功!", "/Match/Index.aspx");
            }
            else
            {
                Show(umsg.Content);
            }
        }
예제 #7
0
        public string Logon(string userName, string userPass, string code)
        {
            string msg = "";

            if (TextUtility.EmptyTrimOrNull(userName) || TextUtility.EmptyTrimOrNull(userPass))
            {
                msg = "抱歉!您输入的用户名或密码错误了。";
                return("{success:'error',msg:'" + msg + "'}");
            }

            //验证码错误
            if (!code.Equals(Fetch.GetVerifyCode( ), StringComparison.InvariantCultureIgnoreCase))
            {
                msg = "抱歉!您输入的验证码错误了。";
                return("{success:'error',msg:'" + msg + "'}");
            }

            Message umsg = accountFacade.Logon(userName, userPass);

            if (umsg.Success)
            {
                UserInfo ui = umsg.EntityList[0] as UserInfo;
                ui.LogonPass = TextEncrypt.EncryptPassword(userPass);

                Fetch.SetUserCookie(ui.ToUserTicketInfo( ));
                string mOrder = ui.MemberOrder == 0 ? "普通会员" : ui.MemberOrder == 1 ? "蓝钻会员" : ui.MemberOrder == 2 ? "黄钻会员" : ui.MemberOrder == 3 ? "白钻会员" : "红钻会员";
                msg = "{success:'success',account:'" + ui.Accounts + "',gid:'" + ui.GameID + "',loves:'" + ui.LoveLiness + "',morder:'" + mOrder + "',fid:'" + ui.FaceID + "'}";
            }
            else
            {
                msg = "{success:'error',msg:'" + umsg.Content + "'}";
            }
            return(msg);
        }
예제 #8
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            AccountsProtect protect = new AccountsProtect();

            protect.UserID      = Fetch.GetUserCookie().UserID;
            protect.InsurePass  = TextEncrypt.EncryptPassword(CtrlHelper.GetTextAndFilter(txtNewPass));
            protect.Response1   = CtrlHelper.GetTextAndFilter(txtResponse1);
            protect.Response2   = CtrlHelper.GetTextAndFilter(txtResponse2);
            protect.Response3   = CtrlHelper.GetTextAndFilter(txtResponse3);
            protect.LastLogonIP = GameRequest.GetUserIP();

            Message umsg = FacadeManage.aideAccountsFacade.ResetInsurePasswd(protect);

            if (umsg.Success)
            {
                RenderAlertInfo2(false, "重置银行密码成功!");
            }
            else
            {
                Show(umsg.Content);
                this.txtResponse1.Text = "";
                this.txtResponse2.Text = "";
                this.txtResponse3.Text = "";
            }
        }
예제 #9
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text     = base.Request["mchid"];
            string text2    = base.Request["out_trade_no"];
            string text3    = base.Request["fee"];
            string text4    = base.Request["sign"];
            string text5    = base.Request["result_code"];
            string arg_66_0 = base.Request["time_end"];

            if (!(text5 == "0"))
            {
                Log.Write("支付系统错误 opstate:" + text5 + " orderid:" + text2);
                base.Response.Write("支付系统错误");
            }
            else
            {
                string text6 = ApplicationSettings.Get("key_168");
                string text7 = string.Concat(new string[]
                {
                    text,
                    "&",
                    text3,
                    "&",
                    text2,
                    "&",
                    text6
                });
                string text8 = TextEncrypt.EncryptPassword(text7);
                if (!(text4.ToLower() == text8.ToLower()))
                {
                    Log.Write(string.Concat(new string[]
                    {
                        "签名错误,signSource=",
                        text7,
                        " mySign=",
                        text8,
                        " Sign=",
                        text4
                    }));
                    base.Response.Write("签名错误");
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = text2;
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(text3) / 100m;
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("success");
                    }
                    else
                    {
                        Log.Write(message.Content);
                    }
                }
            }
        }
예제 #10
0
 public Message Logon(UserInfo user, bool isEncryptPasswd)
 {
     if (!isEncryptPasswd)
     {
         user.LogonPass = TextEncrypt.EncryptPassword(user.LogonPass);
     }
     return(this.accountsData.Login(user));
 }
예제 #11
0
        /// <summary>
        /// 充值按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnPay_Click(object sender, EventArgs e)
        {
            string strAccounts   = CtrlHelper.GetText(txtAccounts);
            string strReAccounts = CtrlHelper.GetText(txtAccounts2);
            string serialID      = CtrlHelper.GetText(txtSerialID);
            string password      = CtrlHelper.GetText(txtPassword);

            if (strAccounts == "")
            {
                RenderAlertInfo(true, "抱歉,请输入游戏帐号。", 2);
                return;
            }
            if (strReAccounts != strAccounts)
            {
                RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2);
                return;
            }
            if (serialID == "")
            {
                RenderAlertInfo(true, "抱歉,请输入充值卡号。", 2);
                return;
            }
            if (password == "")
            {
                RenderAlertInfo(true, "抱歉,请输入卡号密码。", 2);
                return;
            }

            //充值信息
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID = CtrlHelper.GetText(txtSerialID);
            if (userTicket == null)
            {
                detailInfo.OperUserID = 0;
            }
            else
            {
                detailInfo.OperUserID = userTicket.UserID;
            }
            detailInfo.Accounts  = strAccounts;
            detailInfo.ShareID   = 1;           //实卡充值服务标识
            detailInfo.IPAddress = Utility.UserIP;

            #region 充值

            Message umsg = FacadeManage.aideTreasureFacade.FilledLivcard(detailInfo, TextEncrypt.EncryptPassword(txtPassword.Text.Trim()));
            if (umsg.Success)
            {
                RenderAlertInfo(false, "实卡充值成功。", 2);
            }
            else
            {
                RenderAlertInfo(true, umsg.Content, 2);
            }

            #endregion
        }
예제 #12
0
        /// <summary>
        /// 注册按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            if (TextUtility.EmptyTrimOrNull(txtAccounts.Text.Trim()) || TextUtility.EmptyTrimOrNull(txtLogonPass.Text.Trim()))
            {
                Show("抱歉!您输入的用户名或密码错误了。");
                this.txtAccounts.Focus();
                return;
            }

            //验证码错误
            if (!txtCode.Text.Trim().Equals(Fetch.GetVerifyCode(), StringComparison.InvariantCultureIgnoreCase))
            {
                Show("抱歉!您输入的验证码错误了。");
                this.txtAccounts.Focus();
                return;
            }

            Message umsg = accountsFacade.IsAccountsExist(CtrlHelper.GetText(txtAccounts));

            if (!umsg.Success)
            {
                Show(umsg.Content);
                this.txtAccounts.Focus();
                return;
            }

            UserInfo user = new UserInfo();

            user.Accounts      = CtrlHelper.GetText(txtAccounts);
            user.Compellation  = CtrlHelper.GetText(txtCompellation);
            user.FaceID        = Convert.ToInt16(hfFaceID.Value.Trim());
            user.Gender        = Convert.ToByte(ddlGender.SelectedValue);
            user.InsurePass    = TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtInsurePass1));
            user.LastLogonDate = DateTime.Now;
            user.LastLogonIP   = GameRequest.GetUserIP();
            user.LogonPass     = TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtLogonPass));
            user.NickName      = CtrlHelper.GetText(txtNickname);
            user.PassPortID    = CtrlHelper.GetText(txtPassPortID);
            user.RegisterDate  = DateTime.Now;
            user.RegisterIP    = GameRequest.GetUserIP();

            Message msg = accountsFacade.Register(user, CtrlHelper.GetText(txtSpreader));

            if (msg.Success)
            {
                UserInfo ui = msg.EntityList[0] as UserInfo;
                ui.LogonPass = TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtLogonPass));
                Fetch.SetUserCookie(ui.ToUserTicketInfo( ));

                ShowAndRedirect("注册成功!", "/Member/MIndex.aspx");
            }
            else
            {
                Show(msg.Content);
                this.txtAccounts.Focus();
            }
        }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = ApplicationSettings.Get("key_th");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["versionId"]     = base.Request["versionId"];
            dictionary["transType"]     = base.Request["transType"];
            dictionary["asynNotifyUrl"] = base.Request["asynNotifyUrl"];
            dictionary["synNotifyUrl"]  = base.Request["synNotifyUrl"];
            dictionary["merId"]         = base.Request["merId"];
            dictionary["orderAmount"]   = base.Request["orderAmount"];
            dictionary["prdOrdNo"]      = base.Request["prdOrdNo"];
            dictionary["orderStatus"]   = base.Request["orderStatus"];
            dictionary["payId"]         = base.Request["payId"];
            dictionary["payTime"]       = base.Request["payTime"];
            dictionary["signType"]      = base.Request["signType"];
            dictionary = (
                from p in dictionary
                orderby p.Key
                select p).ToDictionary <KeyValuePair <string, string>, string, string>((KeyValuePair <string, string> p) => p.Key, (KeyValuePair <string, string> o) => o.Value);
            string password = string.Concat(PayHelper.PrepareSign(dictionary), "&key=", str);

            dictionary["signData"] = base.Request["signData"];
            if (dictionary["orderStatus"] == "01")
            {
                string text = TextEncrypt.EncryptPassword(password);
                if (dictionary["signData"] == text)
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo()
                    {
                        OrderID   = dictionary["prdOrdNo"],
                        IPAddress = Utility.UserIP,
                        PayAmount = Convert.ToDecimal(dictionary["orderAmount"]) / new decimal(100)
                    };
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (!message.Success)
                    {
                        Log.Write(message.Content);
                    }
                    else
                    {
                        base.Response.Write("SUCCESS");
                    }
                }
                else
                {
                    Log.Write(string.Concat("签名错误,mySign:", text, "——Sign=", dictionary["signData"]));
                    base.Response.Write("签名错误");
                }
            }
            else
            {
                Log.Write("支付系统错误");
                base.Response.Write("支付系统错误");
            }
        }
예제 #14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text     = base.Request["customerid"];
            string text2    = base.Request["sdorderno"];
            string text3    = base.Request["total_fee"];
            string text4    = base.Request["status"];
            string text5    = base.Request["paytype"];
            string text6    = base.Request["sdpayno"];
            string arg_78_0 = base.Request["remark"];
            string text7    = base.Request["sign"];

            if (text4 == "1")
            {
                string text8 = ApplicationSettings.Get("key_lf");
                string text9 = string.Format("customerid={0}&status={1}&sdpayno={2}&sdorderno={3}&total_fee={4}&paytype={5}&{6}", new object[]
                {
                    text,
                    text4,
                    text6,
                    text2,
                    text3,
                    text5,
                    text8
                });
                string text10 = TextEncrypt.EncryptPassword(text9);
                if (text7.ToLower() == text10.ToLower())
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = text2;
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(text3);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("success");
                    }
                    else
                    {
                        Log.Write(message.Content);
                    }
                }
                else
                {
                    Log.Write(string.Concat(new string[]
                    {
                        "签名错误,signSource=",
                        text9,
                        " mySign=",
                        text10,
                        " Sign=",
                        text7
                    }));
                    base.Response.Write("签名错误");
                }
            }
        }
예제 #15
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string Accounts = context.Request.Params["Ilogname"];
            string NickName = context.Request.Params["InickName"];
            //string Compellation = context.Request.Params["Iname"];
            string LogonPass = context.Request.Params["Ipwd"];
            //string PassPortID = context.Request.Params["Iid"];
            string   Spreader = context.Request.Params["Ispre"];
            UserInfo user     = new UserInfo();

            user.Accounts     = Accounts;
            user.Compellation = "";
            //user.FaceID = Convert.ToInt16(hfFaceID.Value.Trim());
            // user.Gender = Convert.ToByte(ddlGender.SelectedValue);
            user.InsurePass    = TextEncrypt.EncryptPassword(LogonPass);
            user.LastLogonDate = DateTime.Now;
            user.LastLogonIP   = GameRequest.GetUserIP();
            user.LogonPass     = TextEncrypt.EncryptPassword(LogonPass);
            user.NickName      = NickName;
            user.PassPortID    = "";
            user.RegisterDate  = DateTime.Now;
            user.RegisterIP    = GameRequest.GetUserIP();

            string strType = "";

            if (System.Web.HttpContext.Current.Request.Cookies["asd"] != null)
            {
                strType = System.Web.HttpContext.Current.Request.Cookies["asd"].Value.ToString();
            }

            int nType = 8;

            if (strType == "2")
            {
                nType = 2;
            }
            else if (strType == "5")
            {
                nType = 5;
            }

            Message msg = accountsFacade.Register(user, Spreader, nType);

            if (msg.Success)
            {
                UserInfo ui = msg.EntityList[0] as UserInfo;
                ui.LogonPass = TextEncrypt.EncryptPassword(LogonPass);
                Fetch.SetUserCookie(ui.ToUserTicketInfo());
                context.Response.Write("success");
            }
            else
            {
                context.Response.Write(msg.Content);
            }
        }
예제 #16
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strAccounts   = context.Request.Params["txtAccounts"];
            string strReAccounts = context.Request.Params["txtAccounts2"];
            string serialID      = context.Request.Params["txtSerialID"];
            string password      = TextEncrypt.EncryptPassword(context.Request.Params["txtPassword"]);

            if (strAccounts == "")
            {
                context.Response.Write("1");
                // RenderAlertInfo(true, "抱歉,请输入游戏账号。", 2);
                return;
            }
            if (strReAccounts != strAccounts)
            {
                context.Response.Write("2");
                //RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2);
                return;
            }
            if (serialID == "")
            {
                context.Response.Write("3");
                // RenderAlertInfo(true, "抱歉,请输入充值卡号。", 2);
                return;
            }
            if (password == "")
            {
                context.Response.Write("4");
                // RenderAlertInfo(true, "抱歉,请输入卡号密码。", 2);
                return;
            }

            //充值信息
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID   = serialID;
            detailInfo.OperUserID = 0;
            detailInfo.Accounts   = strAccounts;
            detailInfo.ShareID    = 1;          //实卡充值服务标识
            detailInfo.IPAddress  = Utility.UserIP;

            #region 充值

            Message umsg = treasureFacade.FilledLivcard(detailInfo, password);
            if (umsg.Success)
            {
                context.Response.Write("0");
                //RenderAlertInfo(false, "实卡充值成功。", 2);
            }
            else
            {
                context.Response.Write(umsg.Content);
                // RenderAlertInfo(true, umsg.Content, 2);
            }
        }
예제 #17
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["app_id"]     = base.Request.Form["app_id"];
            dictionary["order_id"]   = base.Request.Form["order_id"];
            dictionary["pay_seq"]    = base.Request.Form["pay_seq"];
            dictionary["pay_amt"]    = base.Request.Form["pay_amt"];
            dictionary["pay_result"] = base.Request.Form["pay_result"];
            string text = "";

            foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary)
            {
                string text2 = text;
                text = string.Concat(new string[]
                {
                    text2,
                    current.Key,
                    "=",
                    current.Value,
                    "&"
                });
            }
            string text3 = ApplicationSettings.Get("key_san");

            text3 = TextEncrypt.EncryptPassword(text3).ToLower();
            string a = TextEncrypt.EncryptPassword(text + "key=" + text3).ToLower();
            string b = base.Request.Form["sign"];

            if (!(a == b))
            {
                base.Response.Write("签名失败,订单号:" + dictionary["order_id"]);
            }
            else
            {
                if (!(dictionary["pay_result"] == "20"))
                {
                    base.Response.Write("充值失败,订单号:" + dictionary["order_id"]);
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = dictionary["order_id"];
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["pay_amt"]);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("ok");
                    }
                    else
                    {
                        base.Response.Write(message.Content + ",订单号:" + dictionary["order_id"]);
                    }
                }
            }
        }
예제 #18
0
        /// <summary>
        /// 用户登录
        /// </summary>
        public Message Logon(UserInfo user, bool isEncryptPasswd)
        {
            Message umsg;

            if (!isEncryptPasswd)
            {
                user.LogonPass = TextEncrypt.EncryptPassword(user.LogonPass);
            }

            umsg = accountsData.Login(user);
            return(umsg);
        }
예제 #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["orderid"]    = base.Request["orderid"];
            dictionary["result"]     = base.Request["result"];
            dictionary["cardtype"]   = base.Request["cardtype"];
            dictionary["realamount"] = base.Request["realamount"];
            dictionary["dealtime"]   = base.Request["dealtime"];
            dictionary["userpara"]   = base.Request["userpara"];
            dictionary["sign"]       = base.Request["sign"];
            string text     = ApplicationSettings.Get("key_45");
            string password = string.Concat(new string[]
            {
                dictionary["orderid"],
                dictionary["result"],
                dictionary["realamount"],
                dictionary["dealtime"],
                dictionary["cardtype"],
                text
            });
            string b = TextEncrypt.EncryptPassword(password).ToLower();

            if (!(dictionary["result"] == "1"))
            {
                Log.Write("充值失败:" + JsonHelper.SerializeObject(dictionary));
                base.Response.Write("充值失败,订单号:" + dictionary["orderid"]);
            }
            else
            {
                if (!(dictionary["sign"] == b))
                {
                    Log.Write("签名失败:" + JsonHelper.SerializeObject(dictionary));
                    base.Response.Write("签名失败,订单号:" + dictionary["orderid"]);
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = dictionary["orderid"];
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["realamount"]);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("OK");
                    }
                    else
                    {
                        Log.Write(message.Content + ":" + JsonHelper.SerializeObject(dictionary));
                        base.Response.Write(message.Content + ",订单号:" + dictionary["orderid"]);
                    }
                }
            }
        }
예제 #20
0
        public void RetrievePassword(HttpContext context)
        {
            Message       msg      = new Message();
            AjaxJsonValid ajaxJson = new AjaxJsonValid();

            string answer1    = GameRequest.GetFormString("Answer1");
            string answer2    = GameRequest.GetFormString("Answer2");
            string answer3    = GameRequest.GetFormString("Answer3");
            string password   = GameRequest.GetFormString("Password");
            string rePassword = GameRequest.GetFormString("RePassword");
            int    userID     = GameRequest.GetFormInt("UserID", 0);

            #region 参数验证
            if (string.IsNullOrEmpty(answer1) || string.IsNullOrEmpty(answer2) || string.IsNullOrEmpty(answer3))
            {
                ajaxJson.msg = "抱歉,密保答案不能为空";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (string.IsNullOrEmpty(password))
            {
                ajaxJson.msg = "抱歉,新密码不能为空";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (password != rePassword)
            {
                ajaxJson.msg = "抱歉,两次密码输入不一致";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (userID <= 0)
            {
                ajaxJson.msg = "抱歉,找回密码用户不存在";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            #endregion 参数验证

            AccountsProtect protect = new AccountsProtect();
            protect.UserID      = userID;
            protect.LogonPass   = TextEncrypt.EncryptPassword(password);
            protect.Response1   = answer1;
            protect.Response2   = answer2;
            protect.Response3   = answer3;
            protect.LastLogonIP = GameRequest.GetUserIP();

            Message umsg = FacadeManage.aideAccountsFacade.ResetLogonPasswd(protect);
            ajaxJson.SetValidDataValue(umsg.Success);
            ajaxJson.msg = umsg.Content;
            context.Response.Write(ajaxJson.SerializeToJson());
        }
예제 #21
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text = ApplicationSettings.Get("key_ruyi");

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["P_UserId"]    = base.Request["P_UserId"];
            dictionary["P_OrderId"]   = base.Request["P_OrderId"];
            dictionary["P_CardId"]    = base.Request["P_CardId"];
            dictionary["P_CardPass"]  = base.Request["P_CardPass"];
            dictionary["P_FaceValue"] = base.Request["P_FaceValue"];
            dictionary["P_ChannelId"] = base.Request["P_ChannelId"];
            dictionary["P_PayMoney"]  = base.Request["P_PayMoney"];
            dictionary["P_ErrCode"]   = base.Request["P_ErrCode"];
            dictionary["P_PostKey"]   = base.Request["P_PostKey"];
            string password = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}", new object[]
            {
                dictionary["P_UserId"],
                dictionary["P_OrderId"],
                dictionary["P_CardId"],
                dictionary["P_CardPass"],
                dictionary["P_FaceValue"],
                dictionary["P_ChannelId"],
                dictionary["P_PayMoney"],
                dictionary["P_ErrCode"],
                text
            });
            string b = TextEncrypt.EncryptPassword(password).ToLower();

            if (!(dictionary["P_PostKey"].ToLower() == b))
            {
                Log.Write("签名错误:" + JsonHelper.SerializeObject(dictionary));
                base.Response.Write("签名错误");
            }
            else
            {
                ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                shareDetialInfo.OrderID   = dictionary["P_OrderId"];
                shareDetialInfo.IPAddress = Utility.UserIP;
                shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["P_PayMoney"]);
                Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                if (message.Success)
                {
                    base.Response.Write("ErrCode=0");
                }
                else
                {
                    Log.Write(message.Content + ":" + JsonHelper.SerializeObject(dictionary));
                }
            }
        }
예제 #22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text     = ApplicationSettings.Get("key_yika");
            string text2    = base.Request["orderid"];
            string text3    = base.Request["opstate"];
            string text4    = base.Request["ovalue"];
            string text5    = base.Request["sign"];
            string arg_60_0 = base.Request["ekaorderid"];
            string arg_71_0 = base.Request["ekatime"];
            string arg_82_0 = base.Request["attach"];
            string arg_93_0 = base.Request["msg"];
            string password = string.Format("orderid={0}&opstate={1}&ovalue={2}{3}", new object[]
            {
                text2,
                text3,
                text4,
                text
            });

            if (!(text3 == "0"))
            {
                Log.Write("充值失败");
            }
            else
            {
                if (!(text5.ToLower() == TextEncrypt.EncryptPassword(password).ToLower()))
                {
                    Log.Write("签名错误");
                    base.Response.Write("签名错误");
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = text2;
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(text4);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        Log.Write("充值成功");
                        base.Response.Write("充值成功");
                    }
                    else
                    {
                        Log.Write(message.Content);
                        base.Response.Write(message.Content);
                    }
                }
            }
        }
        /// <summary>
        /// 发送重置密码邮件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            AuthUserOperationPermission(Permission.SendMail);
            int reportid = IntParam;

            if (reportid != 0)
            {
                LossReport   report  = FacadeManage.aideNativeWebFacade.GetLossReport(reportid);
                AccountsInfo account = FacadeManage.aideAccountsFacade.GetAccountInfoByUserID(report.UserID);
                string       site    = FacadeManage.aideNativeWebFacade.GetConfigInfo(EnumerationList.SiteConfigKey.SiteConfig.ToString()).Field2;
                string       sign    = TextEncrypt.MD5EncryptPassword(report.ReportNo + report.UserID + report.ReportDate.ToString().Trim() + report.Random + ApplicationSettings.Get("ReportForgetPasswordKey"));
                string       url     = Game.Utils.Utility.UrlEncode(site + string.Format("/Member/Complaint-Setp-4.aspx?param={0}&sign={1}&test=test", report.ReportNo, sign));

                //邮箱配置
                ConfigInfo     mail       = FacadeManage.aideNativeWebFacade.GetConfigInfo(EnumerationList.SiteConfigKey.EmailConfig.ToString());
                MailConfigInfo mailConfig = new MailConfigInfo();
                mailConfig.Accounts        = mail.Field1.Trim();
                mailConfig.Password        = mail.Field2.Trim();
                mailConfig.Port            = Convert.ToInt32(mail.Field4);
                mailConfig.SmtpServer      = mail.Field3.Trim();
                mailConfig.SmtpSenderEmail = mail.Field1.Trim();
                mailConfig.LossreportUrl   = "";

                Dictionary <string, string> renderVals = new Dictionary <string, string>();
                renderVals.Add("reportNO", report.ReportNo);
                renderVals.Add("userName", report.Accounts);
                renderVals.Add("url", url);
                renderVals.Add("mail", mail.Field1);
                renderVals.Add("sitename", FacadeManage.aideNativeWebFacade.GetConfigInfo(EnumerationList.SiteConfigKey.SiteConfig.ToString()).Field1);
                renderVals.Add("reason", "");
                string file = TextUtility.GetFullPath("/Config/lossReportSuccess.config");
                TMLForgetConfigManager.ConfigFilePath = file;
                MailTMLConfigInfo tmlMail = new MailTMLConfigInfo(TMLForgetConfigManager.LoadConfig().MailContent.Text, TMLForgetConfigManager.LoadConfig().MailTitle);
                Game.Facade.Mail.EmailForgetPassword emailFoget = new Game.Facade.Mail.EmailForgetPassword(mailConfig, tmlMail, renderVals);

                //发送邮件
                try
                {
                    emailFoget.Send(report.ReportEmail);
                    report.ProcessStatus = 1;
                    FacadeManage.aideNativeWebFacade.UpdateLossReport(report);
                    MessageBox("成功发送“申诉成功”邮件");
                }
                catch (Exception ex)
                {
                    MessageBox("邮件发送失败" + ex.ToString());
                }
            }
        }
예제 #24
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text = ApplicationSettings.Get("key_gf");

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["orderid"]    = base.Request["orderid"];
            dictionary["opstate"]    = base.Request["opstate"];
            dictionary["ovalue"]     = base.Request["ovalue"];
            dictionary["sysorderid"] = base.Request["sysorderid"];
            dictionary["sign"]       = base.Request["sign"];
            if (!(dictionary["opstate"] == "0"))
            {
                Log.Write("充值失败:" + JsonHelper.SerializeObject(dictionary));
                base.Response.Write("opstate=" + dictionary["opstate"]);
            }
            else
            {
                string password = string.Format("orderid={0}&opstate={1}&ovalue={2}{3}", new object[]
                {
                    dictionary["orderid"],
                    dictionary["opstate"],
                    dictionary["ovalue"],
                    text
                });
                string b = TextEncrypt.EncryptPassword(password).ToLower();
                if (!(dictionary["sign"].ToLower() == b))
                {
                    Log.Write("签名错误:" + JsonHelper.SerializeObject(dictionary));
                    base.Response.Write("签名错误");
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = dictionary["orderid"];
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["ovalue"]);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("opstate=0");
                    }
                    else
                    {
                        Log.Write(message.Content + ":" + JsonHelper.SerializeObject(dictionary));
                    }
                }
            }
        }
        public Message ModifyPowerUserLogonPass(Base_Users admin, Base_Users powerUser, string newPasswd)
        {
            if (admin.UserID != 1 || admin.RoleID != 1)
            {
                return(new Message(false, "您没有修改用户密码的权限。"));
            }
            Message message = GameWebRules.CheckedPassword(newPasswd);

            if (!message.Success)
            {
                return(message);
            }
            newPasswd = TextEncrypt.EncryptPassword(newPasswd);
            aidePlatformManagerData.ModifyUserLogonPass(powerUser, newPasswd);
            return(new Message(true));
        }
예제 #26
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string str = ApplicationSettings.Get("key_wsf");

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["p1_usercode"]      = base.Request["p1_usercode"];
            dictionary["p2_order"]         = base.Request["p2_order"];
            dictionary["p3_money"]         = base.Request["p3_money"];
            dictionary["p4_status"]        = base.Request["p4_status"];
            dictionary["p5_payorder"]      = base.Request["p5_payorder"];
            dictionary["p6_paymethod"]     = base.Request["p6_paymethod"];
            dictionary["p7_paychannelnum"] = base.Request["p7_paychannelnum"];
            dictionary["p8_charset"]       = base.Request["p8_charset"];
            dictionary["p9_signtype"]      = base.Request["p9_signtype"];
            string str2 = "";

            foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary)
            {
                str2 = str2 + current.Value + "&";
            }
            string text = TextEncrypt.EncryptPassword(str2 + str);

            dictionary["p10_sign"]   = base.Request["p10_sign"];
            dictionary["p11_remark"] = base.Request["p11_remark"];
            if (!(text.ToLower() == dictionary["p10_sign"].ToLower()))
            {
                Log.Write("签名错误" + dictionary["p2_order"]);
                base.Response.Write("签名错误");
            }
            else
            {
                ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                shareDetialInfo.OrderID   = dictionary["p2_order"];
                shareDetialInfo.IPAddress = Utility.UserIP;
                shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["p3_money"]);
                Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                if (message.Success)
                {
                    base.Response.Write("success");
                }
                else
                {
                    Log.Write(message.Content + dictionary["p2_order"]);
                }
            }
        }
예제 #27
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            config.AppSettings.Settings["preset-question"].Value = editPreQues.Text;
            config.AppSettings.Settings["salt1"].Value           = editSalt1.Text;
            config.AppSettings.Settings["salt2"].Value           = editSalt2.Text;
            config.AppSettings.Settings["salt3"].Value           = editSalt3.Text;
            config.AppSettings.Settings["key-hash"].Value        =
                GetHash.hash(GetHash.hash(editPreAns.Text, editSalt1.Text) + editPostStr.Text, editSalt2.Text);
            config.AppSettings.Settings["encrypted-text"].Value = TextEncrypt.encrypt(editText.Text,
                                                                                      GetHash.hash(GetHash.hash(editPreAns.Text, editSalt1.Text) + editPostStr.Text, editSalt3.Text));
            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
            File.Copy("key-hash.exe.config", "last-words.exe.config", true);
            MessageBox.Show("已保存");
        }
예제 #28
0
        public static string GateWayPement(string merchant_order, decimal amount, string bank_account, string bank_card_no, string bank_code, string bankAddress, out string flowid)
        {
            string url      = ApplicationSettings.Get("url_san") + "/Pay/GateWayPement.aspx";
            string value    = ApplicationSettings.Get("partner_san");
            string password = ApplicationSettings.Get("key_san");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["mer_id"]     = value;
            dictionary["pay_type"]   = "1";
            dictionary["order_id"]   = merchant_order;
            dictionary["order_amt"]  = amount.ToString();
            dictionary["acct_name"]  = bank_account;
            dictionary["acct_id"]    = bank_card_no;
            dictionary["time_stamp"] = DateTime.Now.ToString("yyyyMMddHHmmss");
            string text = "";

            foreach (KeyValuePair <string, string> item in dictionary)
            {
                string text2 = text;
                text = text2 + item.Key + "=" + item.Value + "&";
            }
            password = TextEncrypt.EncryptPassword(password).ToLower();
            string value2 = Jiami.MD5(text + "key=" + password, "UTF-8").ToLower();

            dictionary["acct_name"]   = HttpUtility.UrlEncode(bank_account, Encoding.UTF8);
            dictionary["acct_type"]   = "0";
            dictionary["bank_code"]   = bank_code;
            dictionary["bank_branch"] = HttpUtility.UrlEncode(bankAddress, Encoding.UTF8);
            dictionary["sign"]        = value2;
            string param = HttpHelper.GetParam(dictionary);
            string json  = HttpHelper.HttpRequest(url, param);
            Dictionary <string, string> dictionary2 = JsonHelper.DeserializeJsonToObject <Dictionary <string, string> >(json);

            flowid = "";
            if (dictionary2.ContainsKey("status_code"))
            {
                if (dictionary2["status_code"] == "0")
                {
                    flowid = dictionary2["pay_seq"].ToString();
                    return("SUCCESS");
                }
                return(dictionary2["status_msg"].ToString());
            }
            return("下单失败");
        }
예제 #29
0
        public static string Daifu_45(string merchant_order, decimal amount, string bank_account, string bank_card_no, string bank_code, string bankAddress, string city, out string flowid)
        {
            string url   = ApplicationSettings.Get("url_45");
            string value = ApplicationSettings.Get("partner_45");
            string str   = ApplicationSettings.Get("key_45");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["UserID"]        = value;
            dictionary["AccountNo"]     = bank_card_no;
            dictionary["AccountName"]   = bank_account;
            dictionary["BankName"]      = bank_code;
            dictionary["OrderID"]       = merchant_order;
            dictionary["Amount"]        = (amount * 100m).ToString();
            dictionary["AccountType"]   = "0";
            dictionary["BankNo"]        = "";
            dictionary["IDType"]        = "";
            dictionary["IDNumber"]      = "";
            dictionary["MobileNo"]      = "";
            dictionary["Province"]      = "";
            dictionary["City"]          = city;
            dictionary["SubbranchName"] = bankAddress;
            Dictionary <string, string> dictionary2 = new Dictionary <string, string>();

            dictionary2["ActionType"] = "SinglePay";
            dictionary2["Data"]       = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonHelper.SerializeObject(dictionary)));
            dictionary2["Sign"]       = TextEncrypt.EncryptPassword(dictionary2["Data"] + str).ToLower();
            string param = JsonHelper.SerializeObject(dictionary2);
            string text  = HttpHelper.HttpRequest(url, param);

            flowid = "";
            if (text.Contains("Status"))
            {
                Dictionary <string, string> dictionary3 = JsonHelper.DeserializeJsonToObject <Dictionary <string, string> >(text);
                if (dictionary3.ContainsKey("Status"))
                {
                    if (dictionary3["Status"] == "OK")
                    {
                        flowid = dictionary3["OrderID"].ToString();
                        return("SUCCESS");
                    }
                    return(dictionary3["StatusMsg"].ToString());
                }
            }
            return(text);
        }
예제 #30
0
        public string editadminpwd(string newpwd, string adminid)
        {
            admininfo data = new admininfo();

            data.adminid    = TypeParse.DbObjToInt(adminid, 0);
            data.adminpwd   = TextEncrypt.EncryptPassword(newpwd);
            data.updatedate = DateTime.Now;
            bool result = admin.updatepwd(data);

            if (result)
            {
                return("t");
            }
            else
            {
                return("f");
            }
        }