ASP.NET?????·??????
???????????? ???????[ 2015/7/6 14:49:03 ] ??????????????????? .NET
????????
???????????ASP.NET????????????ASP.NET??????????????????????ж???ο????????????????????????????????£???л???
???????????
???????????????????????????????????????????????????ó???????????????÷????????????????????????????????????
??????????????????????????????????????
??????????
??????????Web???壬??UserManagers.aspx????????????????????д??????????????????????????SqlDataReader?????????????SqlCommand???????????????
protected void Button1_Click(object sender?? EventArgs e)
{
if (txtName.Text == "" || txtPwd.Text == "" || txtConfirm.Text == "")
{
this.Page.RegisterStartupScript("ss"?? "<script>alert('??????????????')</script>");
return;
}
if (txtPwd.Text.Equals(txtConfirm.Text))
{
//??????????????
SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
sqlConn.Open();
string sql = "select * from tb_user where username = '" + txtName.Text.Trim() + "'";
SqlCommand sqlCommand = new SqlCommand(sql?? sqlConn);
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
if (sqlDataReader.Read())
{
Page.RegisterStartupScript(""?? "<script>alert('???????????')</script>");
return;
}
sqlDataReader.Close();
//???????
string strInsert = "insert into tb_user(username?? pwd?? marks) values (@username??@pwd?? @marks)";
sqlCommand = new SqlCommand(strInsert?? sqlConn);
sqlCommand.Parameters.Add("@username"?? SqlDbType.VarChar);
sqlCommand.Parameters["@username"].Value = txtName.Text;
sqlCommand.Parameters.Add("@pwd"?? SqlDbType.VarChar?? 20);
sqlCommand.Parameters["@pwd"].Value = txtPwd.Text;
sqlCommand.Parameters.Add("@marks"?? SqlDbType.VarChar?? 1000);
sqlCommand.Parameters["@marks"].Value = "zbq????";
sqlCommand.ExecuteNonQuery();
sqlConn.Close();
Page.RegisterStartupScript(""?? "<script>alert('???????')</script>");
Response.Redirect("Default.aspx?Name=" + txtName.Text + "");
}
}
????????Ч??????
????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11