一个vb.net的用户登陆页面代码

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 = "请确认您的输入!"

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 = "您还没有注册或账号密码错误"

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值