yonghuInfo.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class yonghuInfo : System.Web.UI.Page
{
    Alert js = new Alert();
    SqlHelper data = new SqlHelper();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlHelper data = new SqlHelper();
            string id = Session["id"].ToString();
            SqlDataReader dr = data.GetDataReader("select * from yonghu where id=" + id);
            dr.Read();
            yonghuhao.Text = dr["yonghuhao"].ToString();
            xingming.Text = dr["xingming"].ToString();
            dianhua.Text = dr["dianhua"].ToString();
            qq.Text = dr["qq"].ToString();
            weixin.Text = dr["weixin"].ToString();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string id = Session["id"].ToString();
        string yonghuhao = this.yonghuhao.Text;
        string xingming = this.xingming.Text;
        string dianhua = this.dianhua.Text;
        string qq = this.qq.Text;
        string weixin = this.weixin.Text;
        SqlDataReader dr = data.GetDataReader("select * from yonghu where yonghuhao='" + yonghuhao + "' and id!="+id+"");
        if (dr.Read())
        {
            js.Alertjs("用户账号已经存在,不能重复");
            return;
        }
        string strsql = "Update yonghu set yonghuhao='" + yonghuhao + "',xingming='" + xingming + "'";
        strsql += " ,dianhua='" + dianhua + "',qq='" + qq + "',weixin='" + weixin + "' where id=" + id + "";
        data.RunSql(strsql);
        Alert.AlertAndRedirect("修改成功", "yonghuInfo.aspx");
    }
}

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

AI 解读 AI

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

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