Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让 DirectorySearcher 执行跳过第一个条目(例如 100 个条目)并在此之后返回前 7 个条目的搜索?
假设searcher是类型DirectorySearcher:
searcher
DirectorySearcher
searcher.FindAll().OfType<System.DirectoryServices.SearchResult>().Skip(100).Take(7);
干杯
您所能做的就是设置PageSize属性,以便在幕后进行分页,然后按照上面的评论手动进行分页。
PageSize
如果您需要能够稍后回来并从以前的位置重新开始而不再次带回所有初始数据,那么我认为您不走运DirectorySearcher