updateuser.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;

public partial class updateuser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql;
        sql = "select * from allusers where id=" + Session["id"];
        getdata(sql);
    }

    private void getdata(string sql)
    {
        DataSet result = new DataSet();
        result = new Class1().hsggetdata(sql);
        if (result != null)
        {
            if (result.Tables[0].Rows.Count > 0)
            {
                this.Label1.Text = result.Tables[0].Rows[0]["username"].ToString().Trim();
                this.Label2.Text = result.Tables[0].Rows[0]["cx"].ToString().Trim();
                this.TextBox1.Text = result.Tables[0].Rows[0]["names"].ToString().Trim();
                this.TextBox2.Text = result.Tables[0].Rows[0]["tel"].ToString().Trim();
                this.TextBox3.Text = result.Tables[0].Rows[0]["address"].ToString().Trim();
                

            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql;

        sql = "update allusers set names='" + this.TextBox1.Text + "',tel='" + this.TextBox2.Text + "',address='" + this.TextBox3.Text + "' where id=" + Session["id"];
         
        new Class1().hsgexucute(sql);
        Response.Write("<script>javascript:alert('修改成功');</script>");
    }
}

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

AI 解读 AI

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

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