CookieContainer.PerDomainCapacity 屬性

定義

取得或設定 CookieContainer 在每一個網域可以保留的 Cookie 執行個體數目。

public:
 property int PerDomainCapacity { int get(); void set(int value); };
public:
 property int PerDomainCapacity { int get(); };
public int PerDomainCapacity { get; set; }
public int PerDomainCapacity { get; }
member this.PerDomainCapacity : int with get, set
member this.PerDomainCapacity : int
Public Property PerDomainCapacity As Integer
Public ReadOnly Property PerDomainCapacity As Integer

屬性值

每一個網域允許的 Cookie 執行個體數目。

例外狀況

PerDomainCapacity 小於或等於零。

-或-

(PerDomainCapacity 大於允許的 Cookie 實例數目上限 300,且不等於 Int32.MaxValue) 。

備註

如果新 PerDomainCapacity 值小於目前的值,而且如果任何一個定義域集合包含比新值更多的 Cookie 實例,則會剪除集合以符合。 這會使用相同的基本規則,如屬性中所述 Capacity 。 不過,這隻會針對這個網域的集合進行清除。

適用於

另請參閱