Dim UserName As String = e.Form.Controls("用户名").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 * From {User} 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)
If e.Form.Controls("密码").Value = dr("Password") Then _UserName = UserName _UserGroup = dr("Groupname") e.Form.Close Else Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) End If
输入用户名和密码,登录时,怎么总是提示密码错误
|