在已知的VB源代码中怎么查看程序登陆用户名 和密码?
PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesBu...
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Txt用户名.Text = ""
Txt密码.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New OleDbConnection
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
conn.ConnectionString = ("provider=microsoft.jet.oledb.4.0;data source=零售商店管理信息系统.mdb")
cmd.Connection = conn
conn.Open()
cmd.CommandText = "select * from 用户表 where 用户名='" & Txt用户名.Text & "' "
dr = cmd.ExecuteReader
If dr.Read Then
If dr.Item("密码") = Txt密码.Text Then
商店管理系统主页.Show()
商店管理系统主页.Text = 商店管理系统主页.Text & " 当前管理员:" & Txt用户名.Text
yonghu = Txt用户名.Text
Me.Hide()
Else
MsgBox("密码错误,请重新输入!")
End If
Else
MsgBox("该用户不存在,请重新输入!")
End If
conn.Close()
End Sub 展开
Txt用户名.Text = ""
Txt密码.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New OleDbConnection
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
conn.ConnectionString = ("provider=microsoft.jet.oledb.4.0;data source=零售商店管理信息系统.mdb")
cmd.Connection = conn
conn.Open()
cmd.CommandText = "select * from 用户表 where 用户名='" & Txt用户名.Text & "' "
dr = cmd.ExecuteReader
If dr.Read Then
If dr.Item("密码") = Txt密码.Text Then
商店管理系统主页.Show()
商店管理系统主页.Text = 商店管理系统主页.Text & " 当前管理员:" & Txt用户名.Text
yonghu = Txt用户名.Text
Me.Hide()
Else
MsgBox("密码错误,请重新输入!")
End If
Else
MsgBox("该用户不存在,请重新输入!")
End If
conn.Close()
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询