Dim dt As DataTable
Dim cmd As New SQLCommand
cmd.C
'''''''''''''''''''
Dim pts() As String = e.UserName.Split(".")
If pts.length = 2 Then
Dim dr As DataRow
cmd.CommandText = "Sel ect * From {Users} where [Department] = '" & pts(0) & "' And [Name] = '" & pts(1) & "'"
dt = cmd.ExecuteReader
If dt.datarows.count > 0 Then
dr = dt.DataRows(0)
If dr("Password") <> e.Password Then '如果密码错误
e.Message = "登录密码错误!" '返回给登录者的提示信息
Return
End If
Else
e.Message = "用户名错误!" '返回给登录者的提示信息
End If
End If