当前位置: 首页>>代码示例>>C#>>正文


C# Users.EditByID方法代码示例

本文整理汇总了C#中Users.EditByID方法的典型用法代码示例。如果您正苦于以下问题:C# Users.EditByID方法的具体用法?C# Users.EditByID怎么用?C# Users.EditByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users的用法示例。


在下文中一共展示了Users.EditByID方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdatePwd

    private void UpdatePwd(ref string errMsg)
    {
        string lotteryUserId = Request.Form["lotUserId"];
        string pwd = Request.Form["pwd"];
        
        var userId = 0L;
        long.TryParse(lotteryUserId,out userId);

        if (userId <= 0)
        {
            errMsg = string.Format("请求参数不正确lotUserId={0}",userId);
            return ;
        }

        var _User = new Users(1);
        _User.ID = userId;
        var rs = string.Empty;
        _User.GetUserInformationByID(ref rs);

        
        _User.Password = pwd;

        string ReturnDescription = "";

        if (_User.EditByID(ref ReturnDescription) < 0)
        {
            new Log("Users").Write("同步修改密码失败:" + ReturnDescription);
            errMsg = "同步修改密码失败:" + ReturnDescription;

        }

    }
开发者ID:ichari,项目名称:ichari,代码行数:32,代码来源:updatepwd.aspx.cs

示例2: g_ItemCommand

    protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "MemberDetail":
                {
                    Response.Redirect("CpsUsersList.aspx?ID=" + e.Item.Cells[13].Text + "&UserID=" + e.Item.Cells[14].Text);      //Cps ID
                } break;
            case "IncomeDetail":
                {
                    Response.Redirect("CpsSiteBuyDetail.aspx?ID=" + e.Item.Cells[13].Text);  //Cps ID
                } break;
            case "Stop":
                {
                    string ReturnDescription = "";
                    Users user = new Users(_Site.ID);
                    user.cps.ID = Shove._Convert.StrToLong(e.Item.Cells[13].Text, -1);  //Cps ID
                    user.ID = Shove._Convert.StrToLong(e.Item.Cells[14].Text, -1);      //OwnerUserID
                    user.GetUserInformationByID(ref ReturnDescription);
                    user.isCanLogin = false;

                    if (user.EditByID(ref ReturnDescription) < 0)
                    {
                        Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

                        return;
                    }

                    Shove._Web.Cache.ClearCache("Cps_Administrator_CpsWebSiteList");
                    BindData();
                } break;
            case "SetInfo":
                {
                    Response.Redirect("BaseInfo.aspx?ID=" + e.Item.Cells[13].Text); //Cps ID
                } break;
            case "SiteLogin":
                {
                    Users users = new Users(_Site.ID);

                    users.ID = Shove._Convert.StrToLong(e.Item.Cells[14].Text,0);

                    Session["CpsAdminPageBase_Users"] = users;
                    string url;
                    url = "Admin/Default.aspx";
                    string script = "<script>window.open('" + url + "')</script>";
                    Response.Write(script);
                } break;
        }
    }
开发者ID:ichari,项目名称:ichari,代码行数:49,代码来源:CpsPromoterList.aspx.cs

示例3: ResponseToDistination

 public void ResponseToDistination(Users user, string id)
 {
     if (Shove._Web.Cache.GetCache("UserQQBind_" + user.ID.ToString()) != null)
     {
         Shove._Web.Cache.ClearCache("UserQQBind_" + user.ID.ToString());
         if (_Convert.StrToLong(id, 0L) < 1L)
         {
             JavaScript.Alert(this.Page, "您输入的 QQ 号码不合法!");
         }
         else
         {
             Thread.Sleep(500);
             string returnDescription = "";
             user.isQQValided = true;
             user.QQ = id;
             if (user.EditByID(ref returnDescription) < 0)
             {
                 JavaScript.Alert(this.Page, returnDescription);
             }
             else
             {
                 JavaScript.Alert(this.Page, "QQ号码绑定成功。", "UserQQBind.aspx");
             }
         }
     }
     else
     {
         base.Response.Redirect("../../Default.aspx", true);
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:30,代码来源:TencentReceive.aspx.cs

示例4: btnResetPassword_Click

    protected void btnResetPassword_Click(object sender, EventArgs e)
    {
        long SiteID = Shove._Convert.StrToLong(tbSiteID.Text, -1);
        long UserID = Shove._Convert.StrToLong(tbUserID.Text, -1);

        if ((SiteID < 1) || (UserID < 1))
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", "Admin_UserDetail");

            return;
        }

        Users tu = new Users(SiteID)[SiteID, UserID];

        if (tu.ID < 1)
        {
            PF.GoError(ErrorNumber.Unknow, "用户不存在", "Admin_UserDetail");

            return;
        }

        string Password = GetRandPassword();

        tu.Password = Password;
        tu.PasswordAdv = Password;

        string ReturnDescription = "";

        if (tu.EditByID(ref ReturnDescription) < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

            return;
        }

        Shove._Web.JavaScript.Alert(this.Page, "用户密码已经被重置为:" + Password + ",请牢记。");
    }
开发者ID:ichari,项目名称:ichari,代码行数:37,代码来源:UserDetail.aspx.cs

示例5: btnResetPassword_Click

 protected void btnResetPassword_Click(object sender, EventArgs e)
 {
     Thread.Sleep(500);
     string s = Utility.GetRequest("key").Trim();
     if ((s == "") || (s.Length <= 0x20))
     {
         this.pSetp1.Visible = false;
         this.pStep2.Visible = true;
         this.lbError.Text = "非法访问。";
     }
     else
     {
         string str2 = s.Substring(0, 0x10) + s.Substring(s.Length - 0x10, 0x10);
         s = s.Substring(0x10, s.Length - 0x20);
         try
         {
             if (str2 != BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(s))).Replace("-", ""))
             {
                 this.pSetp1.Visible = false;
                 this.pStep2.Visible = true;
                 this.lbError.Text = "非法访问。";
             }
             else
             {
                 s = Encrypt.UnEncryptString(PF.GetCallCert(), s);
                 long num = _Convert.StrToLong(s.Split(new char[] { ',' })[0], 0L);
                 if (Convert.ToDateTime(s.Split(new char[] { ',' })[1]).AddDays(1.0).CompareTo(DateTime.Now) < 0)
                 {
                     this.pSetp1.Visible = false;
                     this.pStep2.Visible = true;
                     this.lbError.Text = "该地址已过期。";
                 }
                 else if (num <= 0L)
                 {
                     this.pSetp1.Visible = false;
                     this.pStep2.Visible = true;
                     this.lbError.Text = "非法访问。";
                 }
                 else
                 {
                     string str3 = this.tbUserPassword.Text.Trim();
                     string str4 = this.tbUserPassword2.Text.Trim();
                     if (str3 == "")
                     {
                         JavaScript.Alert(this, "新密码不能为空。");
                     }
                     else if (str3 != str4)
                     {
                         JavaScript.Alert(this, "两次密码输入不一致,请重新输入。");
                     }
                     else if ((str3.Length < 6) || (str3.Length > 0x10))
                     {
                         JavaScript.Alert(this, "密码长度必须为 6-16 位,请重新输入。");
                     }
                     else if (base._Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true) && !this.ShoveCheckCode1.Valid(this.tbCheckCode.Text.Trim()))
                     {
                         JavaScript.Alert(this, "验证码输入错误。");
                     }
                     else
                     {
                         Users users = new Users(base._Site.ID)
                         {
                             ID = num,
                             Password = str3
                         };
                         string returnDescription = "";
                         if (users.EditByID(ref returnDescription) < 0)
                         {
                             PF.GoError(-1, returnDescription, base.GetType().FullName);
                         }
                         else
                         {
                             users.Login(ref returnDescription);
                             this.pSetp1.Visible = false;
                             this.pStep2.Visible = true;
                             this.lbError.Text = "密码修改成功。<div class='blue' style='margin-top:10px;'>您现在可以前往 <a href='../../Default.aspx'>【购彩大厅】</a> <a href='Default.aspx'>【官网首页】</a></div>";
                         }
                     }
                 }
             }
         }
         catch
         {
             this.pSetp1.Visible = false;
             this.pStep2.Visible = true;
             this.lbError.Text = "非法访问。";
         }
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:89,代码来源:ResetPassword.aspx.cs

示例6: ResponseToDistination

    public void ResponseToDistination(Users user,string id)
    {
        if (Shove._Web.Cache.GetCache("UserQQBind_" + user.ID.ToString()) != null)
        {
            Shove._Web.Cache.ClearCache("UserQQBind_" + user.ID.ToString());
            if (Shove._Convert.StrToLong(id, 0) < 1)
            {
                Shove._Web.JavaScript.Alert(this.Page, "您输入的 QQ 号码不合法!");

                return;
            }

            System.Threading.Thread.Sleep(500);

            int ReturnValue = -1;
            string ReturnDescription = "";

            user.isQQValided = true;
            user.QQ = id;

            ReturnValue = user.EditByID(ref ReturnDescription);

            if (ReturnValue < 0)
            {
                Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

                return;
            }
            Shove._Web.JavaScript.Alert(this.Page, "QQ号码绑定成功。", "UserQQBind.aspx");
        }
        else
        {
            Response.Redirect("../../Default.aspx", true);
        }
    }
开发者ID:ichari,项目名称:ichari,代码行数:35,代码来源:TencentReceive.aspx.cs

示例7: btnSave_Click


//.........这里部分代码省略.........
                }
            }
            

            double ScoringOfSelfBuy = Shove._Convert.StrToDouble(tbScoringOfSelfBuy.Text, -1);

            if (ScoringOfSelfBuy < 0)
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入正确的购彩积分比例。");

                return;
            }

            double ScoringOfCommendBuy = Shove._Convert.StrToDouble(tbScoringOfCommendBuy.Text, -1);

            if (ScoringOfCommendBuy < 0)
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入正确的下级购彩积分比例。");

                return;
            }
            /*
                        double PromotionMemberBonusScale = Shove._Convert.StrToDouble(tbPromotionMemberBonusScale.Text, -1);

                        if (PromotionMemberBonusScale < 0 || PromotionMemberBonusScale > 1)
                        {
                            Shove._Web.JavaScript.Alert(this.Page, "请输入正确的推广会员的佣金比例。");

                            return;
                        }

                        double PromotionSiteBonusScale = Shove._Convert.StrToDouble(tbPromotionSiteBonusScale.Text, -1);

                        if (PromotionSiteBonusScale < 0 || PromotionSiteBonusScale > 1)
                        {
                            Shove._Web.JavaScript.Alert(this.Page, "请输入正确的推广站长的佣金比例。");

                            return;
                        }
                        */
        }

        tu.UserType = (short)(rbUserType2.Checked ? 2 : rbUserType3.Checked ? 3 : 1);

        tu.Email = tbUserEmail.Text.Trim();
        tu.RealityName = tbUserRealityName.Text.Trim();
        tu.IDCardNumber = Shove._Convert.ToDBC(tbUserIDCardNumber.Text.Trim()).Trim();
        tu.CityID = ddlUserCity.City_id;
        tu.Telephone = Shove._Convert.ToDBC(tbUserTelephone.Text.Trim()).Trim();
        tu.Mobile = Shove._Convert.ToDBC(tbUserMobile.Text.Trim()).Trim();
        tu.isMobileValided = (cbUserMobileValid.Checked && (tu.Mobile != ""));
        tu.QQ = Shove._Convert.ToDBC(tbUserQQ.Text.Trim()).Trim();
        tu.Address = tbUserAddress.Text.Trim();
        tu.Sex = rbUserSexM.Checked ? "男" : (rbUserSexW.Checked ? "女" : "");
        tu.BirthDay = DateTime.Parse(tbUserBirthDay.Text.Trim());
        //tu.BankType = short.Parse(ddlUserBankType.SelectedValue);
        tu.BankName = bankName;
        tu.BankCardNumber = Shove._Convert.ToDBC(tbUserBankCardNumber.Text.Trim()).Trim();
        tu.ScoringOfSelfBuy = Shove._Convert.StrToDouble(tbScoringOfSelfBuy.Text, 0);
        tu.ScoringOfCommendBuy = Shove._Convert.StrToDouble(tbScoringOfCommendBuy.Text, 0);
        tu.isPrivacy = cbPrivacy.Checked;
        tu.isCanLogin = cbisCanLogin.Checked;





        /*
        tu.PromotionMemberBonusScale = Shove._Convert.StrToDouble(tbPromotionMemberBonusScale.Text, 0);
        tu.PromotionSiteBonusScale = Shove._Convert.StrToDouble(tbPromotionSiteBonusScale.Text, 0);
        */

        string ReturnDescription = "";
        int returnValue = -1;

        if (tu.EditByID(ref ReturnDescription) < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

            return;
        }

        //绑定银行资料
        if (needBindBankFlag)
        { 
            if (DAL.Procedures.P_UserBankDetailEdit(SiteID, UserID, bankTypeName, bankName, bankCardNumber, bankInProvinceName, bankInCityName, bankUserName, ref returnValue, ref ReturnDescription) < 0)
            {
                tu.Clone(_User);
                Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

                return;
            }
            hfBankInProvince.Value = bankInProvinceName;
            hfBankInCity.Value = bankInCityName;
            hfBankTypeName.Value = bankTypeName;
            hfBankName.Value = bankName;
        }

        Shove._Web.JavaScript.Alert(this.Page, "用户资料已经保存成功。");
    }
开发者ID:ichari,项目名称:ichari,代码行数:101,代码来源:UserDetail.aspx.cs

示例8: btnResetPassword_Click

 protected void btnResetPassword_Click(object sender, EventArgs e)
 {
     long siteid = _Convert.StrToLong(this.tbSiteID.Text, -1L);
     long num2 = _Convert.StrToLong(this.tbUserID.Text, -1L);
     if ((siteid < 1L) || (num2 < 1L))
     {
         PF.GoError(1, "参数错误", "Admin_UserDetail");
     }
     else
     {
         Users users = new Users(siteid)[siteid, num2];
         if (users.ID < 1L)
         {
             PF.GoError(1, "用户不存在", "Admin_UserDetail");
         }
         else
         {
             string randPassword = this.GetRandPassword();
             users.Password = randPassword;
             users.PasswordAdv = randPassword;
             string returnDescription = "";
             if (users.EditByID(ref returnDescription) < 0)
             {
                 JavaScript.Alert(this.Page, returnDescription);
             }
             else
             {
                 JavaScript.Alert(this.Page, "用户密码已经被重置为:" + randPassword + ",请牢记。");
             }
         }
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:32,代码来源:UserDetail.aspx.cs

示例9: btnSave_Click


//.........这里部分代码省略.........
                     JavaScript.Alert(this.Page, "请输入真实姓名。");
                     return;
                 }
                 if (this.tbUserIDCardNumber.Text.Trim() == "")
                 {
                     JavaScript.Alert(this.Page, "请输入身份证号。");
                     return;
                 }
                 if (((!_String.Valid.isIDCardNumber(this.tbUserIDCardNumber.Text.Trim()) && !_String.Valid.isIDCardNumber_Hongkong(this.tbUserIDCardNumber.Text.Trim())) && (!_String.Valid.isIDCardNumber_Macau(this.tbUserIDCardNumber.Text.Trim()) && !_String.Valid.isIDCardNumber_Singapore(this.tbUserIDCardNumber.Text.Trim()))) && !_String.Valid.isIDCardNumber_Taiwan(this.tbUserIDCardNumber.Text.Trim()))
                 {
                     JavaScript.Alert(this.Page, "身份证号格式不正确。");
                     return;
                 }
                 try
                 {
                     DateTime.Parse(this.tbUserBirthDay.Text.Trim());
                 }
                 catch
                 {
                     JavaScript.Alert(this.Page, "请输入正确的生日。");
                     return;
                 }
                 if (flag)
                 {
                     if (bankName == "")
                     {
                         JavaScript.Alert(this.Page, "请输入开户银行。");
                         return;
                     }
                     if (bankCardNumber == "")
                     {
                         JavaScript.Alert(this.Page, "请输入银行卡号。");
                         return;
                     }
                     if (!_String.Valid.isBankCardNumber(bankCardNumber))
                     {
                         JavaScript.Alert(this.Page, "银行卡号格式不正确。");
                         return;
                     }
                     if (bankUserName == "")
                     {
                         JavaScript.Alert(this.Page, "请输入持卡人姓名。");
                         return;
                     }
                 }
                 if (_Convert.StrToDouble(this.tbScoringOfSelfBuy.Text, -1.0) < 0.0)
                 {
                     JavaScript.Alert(this.Page, "请输入正确的购彩积分比例。");
                     return;
                 }
                 if (_Convert.StrToDouble(this.tbScoringOfCommendBuy.Text, -1.0) < 0.0)
                 {
                     JavaScript.Alert(this.Page, "请输入正确的下级购彩积分比例。");
                     return;
                 }
             }
             users.UserType = this.rbUserType2.Checked ? ((short)2) : (this.rbUserType3.Checked ? ((short)3) : ((short)1));
             users.Email = this.tbUserEmail.Text.Trim();
             users.RealityName = this.tbUserRealityName.Text.Trim();
             users.IDCardNumber = _Convert.ToDBC(this.tbUserIDCardNumber.Text.Trim()).Trim();
             users.CityID = this.ddlUserCity.City_id;
             users.Telephone = _Convert.ToDBC(this.tbUserTelephone.Text.Trim()).Trim();
             users.Mobile = _Convert.ToDBC(this.tbUserMobile.Text.Trim()).Trim();
             users.isMobileValided = this.cbUserMobileValid.Checked && (users.Mobile != "");
             users.QQ = _Convert.ToDBC(this.tbUserQQ.Text.Trim()).Trim();
             users.Address = this.tbUserAddress.Text.Trim();
             users.Sex = this.rbUserSexM.Checked ? "男" : (this.rbUserSexW.Checked ? "女" : "");
             users.BirthDay = DateTime.Parse(this.tbUserBirthDay.Text.Trim());
             users.BankName = bankName;
             users.BankCardNumber = _Convert.ToDBC(this.tbUserBankCardNumber.Text.Trim()).Trim();
             users.ScoringOfSelfBuy = _Convert.StrToDouble(this.tbScoringOfSelfBuy.Text, 0.0);
             users.ScoringOfCommendBuy = _Convert.StrToDouble(this.tbScoringOfCommendBuy.Text, 0.0);
             users.isPrivacy = this.cbPrivacy.Checked;
             users.isCanLogin = this.cbisCanLogin.Checked;
             string returnDescription = "";
             int returnValue = -1;
             if (users.EditByID(ref returnDescription) < 0)
             {
                 JavaScript.Alert(this.Page, returnDescription);
             }
             else
             {
                 if (flag)
                 {
                     if (Procedures.P_UserBankDetailEdit(siteid, userID, bankTypeName, bankName, bankCardNumber, bankInProvinceName, bankInCityName, bankUserName, ref returnValue, ref returnDescription) < 0)
                     {
                         users.Clone(base._User);
                         JavaScript.Alert(this.Page, returnDescription);
                         return;
                     }
                     this.hfBankInProvince.Value = bankInProvinceName;
                     this.hfBankInCity.Value = bankInCityName;
                     this.hfBankTypeName.Value = bankTypeName;
                     this.hfBankName.Value = bankName;
                 }
                 JavaScript.Alert(this.Page, "用户资料已经保存成功。");
             }
         }
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:101,代码来源:UserDetail.aspx.cs

示例10: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         Thread.Sleep(500);
         string s = Utility.GetRequest("emailvalidkey").Trim();
         if ((s == "") || (s.Length <= 0x20))
         {
             this.labValided.Text = "非法访问。";
             this.tbOk.Visible = false;
             this.tbFailure.Visible = true;
         }
         else
         {
             string str2 = s.Substring(0, 0x10) + s.Substring(s.Length - 0x10, 0x10);
             s = s.Substring(0x10, s.Length - 0x20);
             try
             {
                 if (str2 != BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(s))).Replace("-", ""))
                 {
                     this.labValided.Text = "非法访问。1";
                     this.tbOk.Visible = false;
                     this.tbFailure.Visible = true;
                 }
                 else
                 {
                     s = Encrypt.UnEncryptString(PF.GetCallCert(), s);
                     long num = -1L;
                     DateTime time2 = DateTime.Now.AddYears(-1);
                     string str3 = "";
                     try
                     {
                         num = _Convert.StrToLong(s.Split(new char[] { ',' })[0], 0L);
                         time2 = Convert.ToDateTime(s.Split(new char[] { ',' })[1]);
                         str3 = s.Split(new char[] { ',' })[2];
                     }
                     catch
                     {
                     }
                     if (time2.AddDays(1.0).CompareTo(DateTime.Now) < 0)
                     {
                         this.labValided.Text = "该地址已过期。";
                         this.tbOk.Visible = false;
                         this.tbFailure.Visible = true;
                     }
                     else if (num <= 0L)
                     {
                         this.labValided.Text = "非法访问。2";
                         this.tbOk.Visible = false;
                         this.tbFailure.Visible = true;
                     }
                     else
                     {
                         string returnDescription = "";
                         Users users = new Users(1L)
                         {
                             ID = num
                         };
                         users.Login(ref returnDescription);
                         if (str3 != users.Email)
                         {
                             this.labValided.Text = "您的邮箱地址不符,请到大厅,我的资料中重新发起激活。<br/><div class='blue12' style='color:black'>前往 <a href=\"Buy.aspx\">购买彩票</a>&nbsp;&nbsp; <a href=\"AccountDetail.aspx\">用户中心</a></div>";
                             this.tbOk.Visible = false;
                             this.tbFailure.Visible = true;
                         }
                         else if (users.isEmailValided)
                         {
                             this.labValided.Text = "您的邮箱已激活,不需要再次激活。<br/><div class='blue12' style='color:black'>前往 <a href=\"Buy.aspx\">购买彩票</a>&nbsp;&nbsp; <a href=\"AccountDetail.aspx\">我的账户</a></div>";
                             this.tbOk.Visible = false;
                             this.tbFailure.Visible = true;
                         }
                         else
                         {
                             users.isEmailValided = true;
                             if (users.EditByID(ref returnDescription) < 0)
                             {
                                 PF.GoError(-1, returnDescription, base.GetType().FullName);
                             }
                             else
                             {
                                 this.tbOk.Visible = true;
                                 this.tbFailure.Visible = false;
                                 this.labValided.Text = "邮箱激活成功。<br/><div class='blue12' color:black'>前往 <a href=\"Buy.aspx\">购买彩票</a> &nbsp; &nbsp; <a href=\"AccountDetail.aspx\">我的账户</a></div>";
                             }
                         }
                     }
                 }
             }
             catch
             {
                 this.labValided.Text = "非法访问。3";
                 this.tbOk.Visible = false;
                 this.tbFailure.Visible = true;
             }
         }
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:97,代码来源:EmailReg.aspx.cs

示例11: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            System.Threading.Thread.Sleep(500);
            string key = Shove._Web.Utility.GetRequest("emailvalidkey").Trim();
            if (key == "" || key.Length <= 32)
            {
                labValided.Text = "非法访问。";
                tbOk.Visible = false;
                tbFailure.Visible = true;

                return;
            }

            string sign = key.Substring(0, 16) + key.Substring(key.Length - 16, 16);

            key = key.Substring(16, key.Length - 32);

            try
            {
                if (sign != BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(key))).Replace("-", ""))
                {
                    labValided.Text = "非法访问。1";
                    tbOk.Visible = false;
                    tbFailure.Visible = true;

                    return;
                }

                key = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), key);

                long userID = -1;
                DateTime time = DateTime.Now.AddYears(-1);
                string email = "";
                try
                {
                    userID = Shove._Convert.StrToLong(key.Split(',')[0], 0);
                    time = Convert.ToDateTime(key.Split(',')[1]);
                    email = key.Split(',')[2];
                }
                catch { }

                if (time.AddDays(1).CompareTo(DateTime.Now) < 0)
                {
                    labValided.Text = "该地址已过期。";
                    tbOk.Visible = false;
                    tbFailure.Visible = true;

                    return;
                }

                if (userID <= 0)
                {
                    labValided.Text = "非法访问。2";
                    tbOk.Visible = false;
                    tbFailure.Visible = true;

                    return;
                }

                string ReturnDescription = "";

                Users user = new Users(1);
                user.ID = userID;
                user.Login(ref ReturnDescription);

                if (email != user.Email)
                {
                    labValided.Text = "您的邮箱地址不符,请到大厅,我的资料中重新发起激活。<br/><div class='blue12' style='color:black'>前往 <a href=\"Buy.aspx\">购买彩票</a>&nbsp;&nbsp; <a href=\"AccountDetail.aspx\">用户中心</a></div>";
                    tbOk.Visible = false;
                    tbFailure.Visible = true;

                    return;
                }

                if (user.isEmailValided)
                {
                    labValided.Text = "您的邮箱已激活,不需要再次激活。<br/><div class='blue12' style='color:black'>前往 <a href=\"../../JCZC/buy_spf.aspx\">购买彩票</a>&nbsp;&nbsp; <a href=\"AccountDetail.aspx\">我的账户</a></div>";
                    tbOk.Visible = false;
                    tbFailure.Visible = true;

                    return;
                }

                user.isEmailValided = true;

                int Result = user.EditByID(ref ReturnDescription);

                if (Result < 0)
                {
                    PF.GoError(-1, ReturnDescription, this.GetType().FullName);

                    return;
                }
                tbOk.Visible = true;
                tbFailure.Visible = false;
                labValided.Text = "邮箱激活成功。<br/><div class='blue12' color:black>前往 <a href=\"../../JCZC/buy_spf.aspx\">购买彩票</a> &nbsp; &nbsp; <a href=\"AccountDetail.aspx\">我的账户</a></div>";
            }
            catch
//.........这里部分代码省略.........
开发者ID:ichari,项目名称:ichari,代码行数:101,代码来源:EmailReg.aspx.cs

示例12: btnResetPassword_Click

    protected void btnResetPassword_Click(object sender, System.EventArgs e)
    {
        System.Threading.Thread.Sleep(500);

        string key = Shove._Web.Utility.GetRequest("key").Trim();

        if (key == "" || key.Length <= 32)
        {
            pSetp1.Visible = false;
            pStep2.Visible = true;

            lbError.Text = "非法访问。";

            return;
        }

        string sign = key.Substring(0, 16) + key.Substring(key.Length - 16, 16);

        key = key.Substring(16, key.Length - 32);

        try
        {
            if (sign != BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(key))).Replace("-", ""))
            {
                pSetp1.Visible = false;
                pStep2.Visible = true;

                lbError.Text = "非法访问。";

                return;
            }

            key = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), key);

            long userID = Shove._Convert.StrToLong(key.Split(',')[0], 0);
            DateTime time = Convert.ToDateTime(key.Split(',')[1]);

            if (time.AddDays(1).CompareTo(DateTime.Now) < 0)
            {
                pSetp1.Visible = false;
                pStep2.Visible = true;

                lbError.Text = "该地址已过期。";

                return;
            }

            if (userID <= 0)
            {
                pSetp1.Visible = false;
                pStep2.Visible = true;

                lbError.Text = "非法访问。";

                return;
            }

            string password = tbUserPassword.Text.Trim();
            string password2 = tbUserPassword2.Text.Trim();

            if (password == "")
            {
                Shove._Web.JavaScript.Alert(this, "新密码不能为空。");

                return;
            }

            if (password != password2)
            {
                Shove._Web.JavaScript.Alert(this, "两次密码输入不一致,请重新输入。");

                return;
            }

            if (password.Length < 6 || password.Length > 16)
            {
                Shove._Web.JavaScript.Alert(this, "密码长度必须为 6-16 位,请重新输入。");

                return;
            }

            bool isUseCheckCode = _Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);

            if ((isUseCheckCode) && !ShoveCheckCode1.Valid(tbCheckCode.Text.Trim()))
            {
                Shove._Web.JavaScript.Alert(this, "验证码输入错误。");

                return;
            }

            Users user = new Users(_Site.ID);

            user.ID = userID;
            user.Password = password;

            string ReturnDescription = "";

            int Result = user.EditByID(ref ReturnDescription);

            if (Result < 0)
//.........这里部分代码省略.........
开发者ID:ichari,项目名称:ichari,代码行数:101,代码来源:ResetPassword.aspx.cs


注:本文中的Users.EditByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。