CookieContainer.Count 属性

定义

获取 Cookie 当前包含的 CookieContainer 实例数。Gets the number of Cookie instances that a CookieContainer currently holds.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

属性值

Cookie 当前包含的 CookieContainer 实例数。The number of Cookie instances that a CookieContainer currently holds. 这是所有域中 Cookie 实例的总数。This is the total of Cookie instances in all domains.

注解

此属性的默认值为 DefaultCookieLimitThe default value of this property is DefaultCookieLimit. 如果 Count 等于或超过 Capacity,则将从该容器中删除一个或多个 Cookie 实例。If Count equals or exceeds Capacity, one or more Cookie instances are removed from the container. 删除了足够多的实例,以使下面 Capacity Count 如下所示:如果范围内有过期的 Cookie 实例,这些实例将被清除。Enough instances are removed to bring Count below Capacity as follows: if there are expired Cookie instances in scope, they are cleaned up. 如果没有,则会找到最近使用过的 CookieCollection,并将其从容器中删除。If not, then the least recently used CookieCollection is found and removed from the container.

适用于

另请参阅