register.aspx.cs

(开头部分) 2KB

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

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

public partial class register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Text = " ";
        TextBox2.Text = " ";
        TextBox3.Text = " ";
        TextBox4.Text = " ";
        TextBox5.Text = " ";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       string strCon = "Data Source=.;Initial Catalog =managetelephone;Integrated Security=True;";
        SqlConnection sqlconn = new SqlConnection(strCon);
        SqlCommand sqlcommand = new SqlCommand();
        sqlcommand.Connection = sqlconn;

        string strsql = "select * from userss where Uname='" + TextBox1.Text + "'";
        SqlDataAdapter da = new SqlDataAdapter(strsql, sqlconn);
        DataSet ds = new DataSet();
        int count = da.Fill(ds, "userss");
        
        if (count > 0)
        {
            TextBox1.Text = ds.Tables["userss"].Rows[0]["Uname"].ToString();
            Label2.Text = "该用户已经存在 ";

        }
        else
        {

            /*string strCon = "Data Source=.;Initial Catalog =managetelephone;Integrated Security=True;";
            SqlConnection sqlconn = new SqlConnection(strCon);
            SqlCommand sqlcommand = new SqlCommand();
            sqlcommand.Connection = sqlconn;*/

            sqlcommand.CommandText = "insert into userss (Uname,Upsd,Uproblem,Uanswer)values(@Uname,@Upsd,@Uproblem,@Uanswer)";
            sqlcommand.Parameters.AddWithValue("@Uname", TextBox1.Text);
            sqlcommand.Parameters.AddWithValue("@Upsd", TextBox2.Text);
            sqlcommand.Parameters.AddWithValue("@Uproblem", TextBox4.Text);
            //sqlcommand.Parameters.AddWithValue("@Upsd", TextBox3.Text);
            sqlcommand.Parameters.AddWithValue("@Uanswer", TextBox5.Text);

            try
            {
                sqlconn.Open();
后面还有 23 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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