CookieContainer.Capacity 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 a Cookie 可容納的實例數量CookieContainer。
public:
property int Capacity { int get(); void set(int value); };
public:
property int Capacity { int get(); };
public int Capacity { get; set; }
public int Capacity { get; }
member this.Capacity : int with get, set
member this.Capacity : int
Public Property Capacity As Integer
Public ReadOnly Property Capacity As Integer
屬性值
a 能成立的實例Cookie數量CookieContainer。 這是一個硬性限制,無法透過加入一個 Cookie來超過。
例外狀況
設定容量小於或等於零,或(值小PerDomainCapacityPerDomainCapacity於且不等於 Int32.MaxValue)。
備註
若 Count 等於或大於 Capacity,則一個或多個 Cookie 實例會從容器中移除。 移除的實例數量足以如下CountCapacity:如果範圍內有過Cookie期實例,會被清理。 如果沒有,則會找到使用較少的 CookieCollection 那個,並從容器中移除。
Capacity 必須大於或等於 PerDomainCapacity。