Count Property
Collapse the table of content
Expand the table of content

CookieContainer.Count Property

Gets the number of Cookie instances a CookieContainer currently holds.

[Visual Basic]
Public ReadOnly Property Count As Integer
public int Count {get;}
public: __property int get_Count();
public function get Count() : int;

Property Value

The number of Cookie instances a CookieContainer currently holds. This is the total of Cookie instances in all domains.


The default value of this property is DefaultCookieLimit. If Count equals or exceeds Capacity, one or more Cookie instances are removed from the container. Enough instances are removed to bring Count below Capacity as follows: if there are expired Cookie instances in scope they are cleaned up. If not, then the least recently used CookieCollection is found and removed from the container.


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

© 2016 Microsoft