DirectoryEntry de = new DirectoryEntry("LDAP://" + hostName + "/OU=" + ou_departCur + ",OU=" + ou_depart1 + ",OU=" + ou_compary + ",DC=" + hostName + ",DC=" + hostNameArea + "");
这个里面的地址不对,应该从哪儿找这个地址呢,
这个里面的地址不对,应该从哪儿找这个地址呢,
string path;
SearchResult result;
SearchResultCollection resultList;
ResultPropertyCollection myResultPropColl;
DirectoryEntry entry; path = ConfigurationManager.AppSettings["LdapPath"];
//entry = new DirectoryEntry(path);
searcher = new DirectorySearcher(path);
searcher.Filter = "";
result = searcher.FindOne();
string distinguishedName = result.Properties["distinguishedname"][0].ToString();