我遇到了这个错误:
发生操作错误
此处发生错误:
SearchResult findUser = searcher.FindOne();
完整代码:
DirectorySearcher searcher = new DirectorySearcher();
searcher.SearchScope = SearchScope.Subtree;
string UserName = Page.User.Identity.Name;
searcher.Filter = string.Format(CultureInfo.InvariantCulture,
"(sAMAccountName={0})", UserName);
SearchResult findUser = searcher.FindOne();