CookieContainer.Add Method (Cookie)
[Visual Basic] Overloads Public Sub Add( _ ByVal cookie As Cookie _ ) [C#] public void Add( Cookie cookie ); [C++] public: void Add( Cookie* cookie ); [JScript] public function Add( cookie : Cookie );
|ArgumentNullException||cookie is a null reference (Nothing in Visual Basic)|
|ArgumentException||domain for cookie is a null reference (Nothing in Visual Basic)|
|CookieException||cookie is larger than maxCookieSize|
If the Count property equals or exceeds the Capacity property, one or more Cookie instances are removed from the container before adding the cookie parameter. Enough Cookie instances are removed to bring Count below Capacity as follows: if there are expired instances in given 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