标题:这段代码是用什么编译的?什么语言啊?
取消只看楼主
qq634564111
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2012-1-5
结帖率:33.33%
已结贴  问题点数:10 回复次数:1 
这段代码是用什么编译的?什么语言啊?
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
            Dim str As String
            Dim passstr As String
            passstr = Trim(CStr(TextBox2.Text))
            str = "'" & TextBox1.Text & "'"
            Dim sql As String = "select * from adminlist where 帐号=" & Trim(str)
            ‘在数据库中搜索帐号为textbox1.text的数据’
            Dim connstr As String = "server=localhost;uid=sa;pwd=;database=book"
            Dim myconn As New SqlClient.SqlConnection(connstr)
            Dim da As New SqlClient.SqlDataAdapter(sql, myconn)
            Dim ds As New DataSet
            da.Fill(ds, "adminlist")
            Dim dacomm As SqlClient.SqlCommandBuilder = New SqlClient.SqlCommandBuilder(da)
           If ds.Tables("adminlist").Rows.Count = 1 Then
    ’判断帐号密码是否和数据库匹配’
                If passstr = Trim(ds.Tables("adminlist").Rows(0)("密码")) Then
                    Response.Redirect("book.aspx")
                Else
                    Response.Write("密码错误!")
                End If
            Else
                Response.Write("用户名不存在!")
            End If
        End Sub
    End Class
搜索更多相关主题的帖子: server database localhost 帐号 
2012-06-03 11:30
qq634564111
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2012-1-5
得分:0 
回复 4楼 zwffff
能不能帮我注释下  ? 这只是一部分代码
2012-06-03 22:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-370703-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.054648 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved