0
我有一個方法,將特定的用戶搜索到ADAM。如何搜索單用戶從LADP:
'set up the LDAP entry object
objEntry = New DirectoryEntry("LDAP://" & m_strLDAPServer & ":" & m_strLDAPPort & "/" & m_strLDAPEntry)
is the default but it must be set explicitly so that the props array can be passed in
objSearcher = New DirectorySearcher(objChild, "(objectClass=*)", strProps)
objSearcher.SearchScope = SearchScope.Base
objSearcher = New DirectorySearcher(objChild, "(objectClass=*)", strProps)
objSearcher.SearchScope = SearchScope.Base
'carry out the search
Try
objResult = objSearcher.FindOne()
Catch
objResult = Nothing
End Try
我想要得到的結果,從ADAM SQL:像'%strUserName中%',但我發現的唯一方法FindOne(),只有搜索完整的字符串 「strUserName中」,但它不執行SQL Like操作。 任何想法如何像SQL LIKE一樣進行搜索?
其工作原理類似於SQL'LIKE'操作。 –