i 对VB.net非常新。 可以使用美国广播公司的声明,将登机和搜索器称作以下。
Using entry As DirectoryEntry = New DirectoryEntry(String.Format("LDAP://xxx.com.my"))
entry.AuthenticationType = AuthenticationTypes.Delegation
entry.Username = username
entry.Password = password
Using searcher As New DirectorySearcher(entry)
searcher.SearchScope = SearchScope.OneLevel
Try
Dim results As SearchResult = searcher.FindOne
success = Not (results Is Nothing)
Catch ex As Exception
success = False
WriteToFile("ValidateADLogin error : " & ex.Message)
End Try
End Using
End Using