Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
Dim dt1 As Date
cmd.C
cmd.CommandText = "Select GetDate()"
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * Fro m {Users} Where [Name] = \'" & UserName & "\'"
dt = cmd.ExecuteReader
dt = dt.Date
If dt.DataRow(0)("Endtime") < dt Then
Messagebox.show("过期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
If e.Fo rm.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If