VB.NET中怎么實(shí)現(xiàn)用戶登錄頁面,很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
成都創(chuàng)新互聯(lián)主營攸縣網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都APP應(yīng)用開發(fā),攸縣h5微信小程序開發(fā)搭建,攸縣網(wǎng)站營銷推廣歡迎攸縣等地區(qū)企業(yè)咨詢
VB.NET用戶登錄頁面代碼示例:
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e
As System.EventArgs) Handles
Button2.ClickIf TextBox3.Text = "" Or
TextBox4.Text = "" ThenLabel35.Text = "請(qǐng)確認(rèn)您的輸入!"
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.Textcomm.Parameters.Add(New SqlParameter
("@pwd", SqlDbType.Char, 16))comm.Parameters("@pwd").Value =
TextBox4.TextDim 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 = "您還沒有注冊(cè)或賬號(hào)密碼錯(cuò)誤"
End If
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ClickTextBox1.Text = ""
TextBox2.Text = ""
End Sub
看完上述內(nèi)容是否對(duì)您有幫助呢?如果還想對(duì)相關(guān)知識(shí)有進(jìn)一步的了解或閱讀更多相關(guān)文章,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對(duì)創(chuàng)新互聯(lián)的支持。