System/user_open.aspx.cs

(完整代码) 1KB

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 System.Data.SqlClient;

public partial class System_user : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["username"]) == "")
        {
            Response.Write("<script language=javascript>alert('请登录');location='../login.aspx'</script>");
        }
        if (!IsPostBack)
        {
            SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
            strcon.Open();
            SqlCommand scd = new SqlCommand("select zh from yhxx where yhid="+Request["id"],strcon);
            this.username.Text = Convert.ToString(scd.ExecuteScalar()); ;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        if (userpwd .Text== "")
        {
            Response.Write("<script>alert('密码中不能含有非法字符');history.back()</script>");
            Response.End();
        }
        SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
        strcon.Open();
        SqlCommand scd = new SqlCommand("update yhxx set pwd='" + userpwd.Text + "'  where yhid='" + Request["id"] + "'", strcon);
        scd.ExecuteNonQuery();
        strcon.Close();
        Response.Write("<script>alert('密码修改成功');opener.location='user_manage.aspx';window.close()</script>");
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。