userinfo_safe.aspx.cs

来自「最好用的站点内容管理系统 全部源代码都有」· CS 代码 · 共 81 行

CS
81
字号
//======================================================
//==     (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 manage_user_userinfo_safe : NetCMS.Web.UI.ManagePage
{
    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;
            string uids =Request.QueryString["id"];
            int uid = 0;
            try
            {
                uid = int.Parse(uids);
            }
            catch (Exception US)
            {
                PageError("错误的参数"+US.ToString()+"", "");
            }
            suid.Value = uid.ToString();
            DataTable dt = rd.sel_sysInfos(uid,2);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    PassQuestion.Text = dt.Rows[0]["PassQuestion"].ToString();
                }
            }
        }
    }

    protected void submitSave(object sender, EventArgs e)
    {
        if (Page.IsValid == true)                       //判断是否验证成功
        {
            string PassQuestion = this.PassQuestion.Text;
            string oldpassword = this.oldpassword.Text;;
            string PassKey = this.PassKey.Text;
            string password = this.password.Text;
            int suid = int.Parse(Request.Form["suid"].ToString());
            if ((PassQuestion != null && PassQuestion != "") && (PassKey != null && PassKey != "") && (password != null && password != ""))
            {
                if (password.ToString() != oldpassword.ToString())
                {
                    PageError("二次密码不一致", "userlist.aspx");
                }
                else
                {
                    rd.UpdateUserSafe(suid, PassQuestion, PassKey, password);
                    PageRight("安全资料成功!", "userlist.aspx");
                }
            }
            else
            {
                PageError("所有项目必须填写", "");
            }
        }
    }
}

⌨️ 快捷键说明

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