在DirectoryServices.Protocol中遇到大小限制超出异常时如何获得部分结果 [英] How to get partial results when encountering a s Size limit exceeded exception in DirectoryServices.Protocol

查看:49
本文介绍了在DirectoryServices.Protocol中遇到大小限制超出异常时如何获得部分结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在返回大量条目的LDAP服务器上搜索entires时,如果您发现超过您在大小限制中指定的条目,则会出现此异常。 虽然我非常了解  PageResultRequestControl适用于Active Directory,
在其他LDAP实现中不直接支持它。也就是说他们可能有其他的分页实现,但我更愿意找到一种方法,这样做可以全面运作。

When searching for entires on an LDAP server with a large number of entries returned, if you find more than you specify in the size limit, you get this exception. While I am quite aware of the PageResultRequestControl that works with Active Directory, it isn't directly supported in other LDAP implementations. That is to say they might have other paging implementations but I'd prefer to find an way of doing this that works across the board.

不使用分页控件,有没有办法在发生大小限制异常之前获取部分结果集?如果大小限制为1000,是否有办法获得前1000并且不关心任何事情?这将是与Active Directory管理工具类似的行为
,您可以在其中选择要查看的数量,并忽略任何超出限制的行为。这实际上是LDAP浏览工具中相当常见的行为,以阻止提供超过某一点的结果,但是到目前为止所有条目
都可用。

Without using a paging control, is there any way to get the partial result set before the size limit exception occurs? If the size limit is 1000, is there no way to get the first 1000 and not care about anything over that? This would be a similar behavior to the Active Directory management tool in which you select how many you want to see and it ignores any over the limit. This is actually a rather common behavior among LDAP browsing tools to stop providing results past a certain point, but all the entries till that point are available.

使用DirectoryServices时。 Protocols.SearchRequest,当调用LdapConnection.SendRequest时,它会抛出大小限制异常,因此显然无法返回具有部分结果的SearchResponse。如果有一种方法可以通过异步
调用来实现这一点,我无法通过使用它来解决这个问题,尽管我不得不考虑这个问题的时间有限并且所有在线查找答案的尝试都会导致分页控制在这种情况下不起作用。

While using the DirectoryServices.Protocols.SearchRequest, when LdapConnection.SendRequest is called, it throws the size limit exception, so it obviously can't return the SearchResponse with partial results. If there is a way to do this with the asynchronous calls I haven't been able to figure it out by playing with it, though the amount of time I've had to look into this has been a bit limited and all attempts to find answers to this online always lead to the paging control that doesn't work in this case.

想法?

推荐答案

是的,您可以捕获异常并查看其Response.Entries属性!
Yes, you can catch the exception and see its Response.Entries property!


这篇关于在DirectoryServices.Protocol中遇到大小限制超出异常时如何获得部分结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆