The following program is used to verify the user login A total of two buttons, one is used to submit, one is used to refill, the page part is very simple, two text boxes, two buttons, here the page code is not written:)
Private Sub button2_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button2.click
If TextBox3.Text = "" Or textbox4.text = "" Then
Label35.text = "Please confirm your input!" "
Return
End If
Dim SQL as String = "SELECT * from pwd where stu_id= @stu_id and pwd= @pwd"
Dim Comm as SqlCommand = New SqlCommand (SQL, conn)
Comm. Parameters.Add (New SqlParameter ("@stu_id", SqlDbType.Int, 4))
Comm. Parameters ("@stu_id"). Value = TextBox3.Text
Comm. Parameters.Add (New SqlParameter ("@pwd", SqlDbType.Char, 16))
Comm. Parameters ("@pwd"). Value = Textbox4.text
Dim Dr as SqlDataReader
Conn. Open ()
Dr = Comm. ExecuteReader
If Dr. Read Then
Session ("stu_id") = TextBox3.Text
Dr. Close ()
Comm. Cancel ()
Dim sql_3 as String = "Update stu_base set point=point+1 where stu_id= @stu_id"
Comm = New SqlCommand (sql_3, conn)
Comm. Parameters.Add (New SqlParameter ("@stu_id", SqlDbType.Int, 4))
Comm. Parameters ("@stu_id"). Value = Session ("stu_id")
Comm. ExecuteNonQuery ()
Comm. Cancel ()
Response.Redirect ("Detail.aspx?stu_id= '" & Session ("stu_id") & "'")
Else
Label35.text = "You have not registered or account password error"
End If
End Sub
Private Sub button1_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.