csharp - retrieve LDAP

Posted h.yl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp - retrieve LDAP相关的知识,希望对你有一定的参考价值。

 1 DirectoryEntry de = new DirectoryEntry("LDAP://10.10.10.10:389");
 2             DirectorySearcher searcher = new DirectorySearcher(de, string.Format("(&(objectClass=user)(samAccountName={0}))", "A00106"));
 3             SearchResultCollection src = searcher.FindAll();
 4             foreach (SearchResult rs in src)
 5             {
 6                 if (rs != null)
 7                 {
 8                     string n = (rs.GetDirectoryEntry().Properties["distinguishedName"].Value == null) ? string.Empty : rs.GetDirectoryEntry().Properties["distinguishedName"].Value.ToString();
 9                     if (n.IndexOf("OU") != -1)
10                     {
11                         //displayName,sAMAccountName,name,mail
12                         string email = (rs.GetDirectoryEntry().Properties["mail"].Value == null) ? string.Empty : rs.GetDirectoryEntry().Properties["mail"].Value.ToString();
13                     }
14                 }
15             }

 

以上是关于csharp - retrieve LDAP的主要内容,如果未能解决你的问题,请参考以下文章

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailUsingOpenEntityStrea

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailUsingOpenEntityStrea

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailUsingOpenEntityStrea

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailsUsingEntityIMAP.cs

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailsUsingEntityIMAP.cs

csharp 例如-CSHARP-GroupDocs.Text.Examples.CSharp-ContainerExtractor-RetrieveEmailsUsingEntity.cs