提示密码不正确,这种问题,应该你自己调试,密码正确与否,计算机是不会撒谎的。
Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * Fr om {Users} Where [Name] = '" & UserName & "'"
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
MessageBox.show(e.Form.Controls("PassWord").Value)
MessageBox.show(dr("Password") )
If e.Form.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
' cmd.CommandText = "UPD ATE {Users} SET 登陆次数 =" & dr("登陆次数")+1 & " WH ERE Name ='" & _UserName & "'"
e.Form.Close
If cmd.ExecuteNonQuery = 1 Then '返回1表示增加成功
'Vars("隐藏") = "False"
'Dim frm As WinForm.Form
'frm = Forms("用户列表")
'frm.Open(SysInfo.ScreenWidth-300, SysInfo.ScreenHeight-600)
'
End If
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If