您所在的位置:开发 > .NET > VB.NET > 一个vb.net的用户登陆页面代码

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

2006-12-06 16:27 中国IT实验室 我要评论(0) 字号:T | T
一键收藏,随时查看,分享好友!

本文给出了一个使用vb.net,编辑的用户登陆页面的源代码程序。

AD:

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


关于.Net  VB  页面  代码的更多文章

网友评论TOP5

查看所有评论(

提交评论

  1. 编程排行榜:图形编程的LOGO语言
  2. 什么是响应式Web设计?

热点专题

更多>>

读书

Visual C# 2005从入门到精通
Microsoft Visual C#功能强大、使用简单。本书全面介绍了如何利用Visual Studio2005和NET Framework来进行C#编程。作者将C#的各

51CTO旗下网站

领先的IT技术网站 51CTO 领先的中文存储媒体 WatchStor 中国首个CIO网站 CIOage 中国首家数字医疗网站 HC3i 移动互联网生活门户 灵客风LinkPhone