Export (0) Print
Expand All

CookieContainer.PerDomainCapacity Property

Gets and sets the number of Cookie instances a CookieContainer can hold per domain.

[Visual Basic]
Public Property PerDomainCapacity As Integer
[C#]
public int PerDomainCapacity {get; set;}
[C++]
public: __property int get_PerDomainCapacity();
public: __property void set_PerDomainCapacity(int);
[JScript]
public function get PerDomainCapacity() : int;
public function set PerDomainCapacity(int);

Property Value

The number of Cookie instances allowed per domain.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException PerDomainCapacity is less than or equal to zero

or

(PerDomainCapacity is greater than the maximum allowable number of cookies instances, 300, and is not equal to MaxValue)

Remarks

If the new PerDomainCapacity value is less than the current value, and if any of the domain collections contain more Cookie instances than the new value, the collections are pruned to fit. This uses the same basic rules as described in the Capacity property. However, this does the clean-up only on the collection for this domain.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CookieContainer Class | CookieContainer Members | System.Net Namespace | Cookie | CookieCollection | CookieContainer | CookieException

Show:
© 2014 Microsoft