0
using (DirectoryEntry rootEntry = new DirectoryEntry(ConfigurationKeys.Ldap, string.Empty, string.Empty, AuthenticationTypes.None))
{
using (DirectorySearcher adSearch = new DirectorySearcher(rootEntry))
{
adSearch.SearchScope = SearchScope.Subtree;
adSearch.PropertiesToLoad.Add("givenname");
adSearch.PropertiesToLoad.Add("mail");
adSearch.Filter = "([email protected])";
SearchResult adSearchResult = adSearch.FindOne();
}
}
從上面的示例中,檢索屬性「givenname」並將其存儲到字符串變量中的最有效方法是什麼?從LDAP/Active Directory中讀取屬性的最快方法搜索結果