zoukankan      html  css  js  c++  java
  • c#SearchResultCollection的所有属性 dodo

     string aaa = System.Threading.Thread.CurrentPrincipal.Identity.Name;

                DirectorySearcher ds = new DirectorySearcher();
                ds.SearchRoot = new DirectoryEntry("LDAP://888.888.0.11/CN=Users,DC=***,DC=com", "***", "***");
                ds.Filter = "(objectClass=user)";
                ds.SearchScope = SearchScope.Subtree;
                ds.Sort = new SortOption("Name", System.DirectoryServices.SortDirection.Ascending);
                ds.PageSize = 1024;
                SearchResultCollection rs = ds.FindAll();

                foreach (SearchResult r in rs)
                {
                    ResultPropertyCollection rprops = r.Properties;
                    string prop = null;
                    foreach (string name in rprops.PropertyNames)
                    {
                        foreach (object vl in rprops[name])
                        {
                            prop = name + ":" + vl.ToString();
                            ls.Add(prop);
                        }
                    }
                }

  • 相关阅读:
    DebugView使用技巧
    网络抓包--Wireshark
    常用curl命令
    chrome.debugger
    修改php.ini 的timezone
    初识Elasticsearch,bulk 操作的遇到的那些事
    chrome 扩展 调试
    sqlite 时间戳转时间
    centos 升级sqlite3
    php 安装redis
  • 原文地址:https://www.cnblogs.com/zgqys1980/p/1639434.html
Copyright © 2011-2022 走看看