Edit.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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;
namespace SCard
{

    public partial class Reg : System.Web.UI.Page
    {
        public string newid;

        protected void Button1_Click(object sender, EventArgs e)
        {


            string DBPath = ConfigurationSettings.AppSettings["DataBasePath"];
            string connStr = (DBPath);
            SqlConnection con = new SqlConnection(connStr);
        
            con.Open();
            if (this.txtUserName.Text.ToString().Length == 0)
            {
                Response.Write("<script>alert('用户名称未填写')</script>");
                return;
            }

            string UserName, Psw, 年龄, 联系方式, 备注, 真实姓名;


            UserName = this.txtUserName.Text;
            Psw = this.txtPsw.Text;
            真实姓名 = this.TextBox1.Text;
            联系方式=txtZh.Text;
            年龄 = this.txtOld.Text;
   
            备注 = this.txtNode.Text;
            string sSql;
            if (Psw + "" != "")
            { sSql = "Update tblUser set  username='" + UserName + "',联系方式='" + 联系方式 + "',  真实姓名='" + 真实姓名 + "',Psw='" + Psw + "',年龄='" + 年龄 + "',备注='" + 备注 + "'where UserName='" + Label1.Text + "'"; }
            else
            { sSql = "Update tblUser set  username='" + UserName + "',联系方式='" + 联系方式 + "',  真实姓名='" + 真实姓名 + "',年龄='" + 年龄 + "',备注='" + 备注 + "'where UserName='" + Label1.Text + "'"; }
            

            SqlCommand cmd = new SqlCommand(sSql, con);
            cmd.ExecuteNonQuery();

            Response.Write("<script>alert('用户信息修改成功!请重新登陆')</script>");
            

        }
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
后面还有 38 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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