科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网软件频道基础软件一个vb.net的用户登陆页面代码

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

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

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

作者:佚名 来源:中国IT实验室 2008年6月9日

关键字: 代码 登陆 VB vb.net Windows

  • 评论
  • 分享微博
  • 分享邮件
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

    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章