⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userinfo_safe.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NetCMS.Content;
using NetCMS.Content.Common;

public partial class user_info_userinfo_safe : NetCMS.Web.UI.UserPage
{
    UserMisc rd = new UserMisc();
    rootPublic pd = new rootPublic();
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        if (!IsPostBack)
        {
            
            copyright.InnerHtml = CopyRight;
            DataTable dt = rd.sel_sysInfos(pd.getUserName_uid(NetCMS.Global.Current.UserNum),2);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    PassQuestion.Text = dt.Rows[0]["PassQuestion"].ToString();
                    //PassKey.Text = dt.Rows[0]["PassKey"].ToString();
                }
            }
        }
    }

    protected void submitSave(object sender, EventArgs e)
    {
        if (Page.IsValid == true)                       //判断是否验证成功
        {
            string PassQuestion = this.PassQuestion.Text;
            string newpassword = this.newpassword.Text; ;
            string PassKey = this.PassKey.Text;
            string password = this.password.Text;
            string oldPassword = this.oldPassword.Text;
            if ((PassQuestion != null && PassQuestion != "") && (PassKey != null && PassKey != "") && (password != null && password != ""))
            {
                if (rd.getPasswordTF(oldPassword.ToString()) == 0)
                {

                    if (password.ToString() != newpassword.ToString())
                    {
                        PageError("二次密码不一致", "userinfo_safe.aspx");
                    }
                    else
                    {
                        rd.UpdateUserSafe(pd.getUserName_uid(NetCMS.Global.Current.UserNum), PassQuestion, PassKey, newpassword);
                        PageRight("安全资料成功!", "userinfo_safe.aspx");
                    }
                }
                else
                {
                    PageError("原始密码不正确", "");
                }
            }
            else
            {
                PageError("所有项目必须填写", "");
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -