Public Function ValidateLDAPLogin(ByVal strUsername As String, ByVal strPassword As String, ByVal strLDAPServerIP As String) As String
Dim entry As New DirectoryEntry("LDAP://" & strLDAPServerIP & "/rootDSE", strUsername, strPassword, AuthenticationTypes.Secure)
Try
Dim strName As String = entry.Name ' PPI: This is one simple try, if failed, User isn't
Return ConfigurationSettings.AppSettings("strResponseOK")
Catch ex As System.Runtime.InteropServices.COMException
Return ex.Message
End Try
End Function
2 comentários:
Public Function ValidateLDAPLogin(ByVal strUsername As String, ByVal strPassword As String, ByVal strLDAPServerIP As String) As String
Dim entry As New DirectoryEntry("LDAP://" & strLDAPServerIP & "/rootDSE", strUsername, strPassword, AuthenticationTypes.Secure)
Try
Dim strName As String = entry.Name ' PPI: This is one simple try, if failed, User isn't
Return ConfigurationSettings.AppSettings("strResponseOK")
Catch ex As System.Runtime.InteropServices.COMException
Return ex.Message
End Try
End Function
escusavas de falar nesses termos, se não fosse boa pessoa ...
Enviar um comentário