Display_info.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 ClassLibrary2;
using System.Data.SqlClient;
using System.Data;
public partial class Display_info : System.Web.UI.Page
{
    string str = System.Configuration.ConfigurationManager.AppSettings["str_con"].ToString(); //连接数据库
    protected void Page_Load(object sender, EventArgs e)
    {
        L_yhm.Text = Value.yhm;
        L_pwd.Text = Value.pwd;
        L_Re_name.Text = Value.name;
        L_email.Text = Value.email;
        L_phone.Text = Value.phone;
        // 地址 
        L_address.Text = Value.address;
        
        Image_dis.ImageUrl = "\\Image\\" + Value.photo;
    }
    protected void Button1_Click(object sender, EventArgs e)
    { 

              SqlConnection conn = new SqlConnection(str);
              conn.Open();
              string sql = "insert into  [dbo].[顾客信息](username,password,realname,email,phone,address,photo) values('" + L_yhm.Text.Trim() + "','" + L_pwd.Text.Trim() + "','" + L_Re_name.Text.Trim() + "','" + L_email.Text.Trim() + "','" + L_phone.Text.Trim() + "','" + L_address.Text.Trim() + "','" + Image_dis.ImageUrl + "')"; 
              SqlCommand cmd1 = new SqlCommand(sql, conn);
              cmd1.ExecuteNonQuery();

              Response.Write("<script> alert('注册成功!');window.location='startPage.aspx';</script>");
              conn.Close();

              L_yhm.Text = "";
              L_pwd.Text = "";
              L_Re_name.Text = "";
              L_email.Text = "";
              L_phone.Text = "";
              L_address.Text = "";
              Image_dis.Visible=false;

              Value.name = "";
              Value.pwd = "";
              Value.phone = "";
              Value.email = "";
              Value.photo = "";
              Value.yhm = "";

        
    } 
}

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

AI 解读 AI

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

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