CookieContainer.Add Method (Uri, CookieCollection)
[Visual Basic] Overloads Public Sub Add( _ ByVal uri As Uri, _ ByVal cookies As CookieCollection _ ) [C#] public void Add( Uri uri, CookieCollection cookies ); [C++] public: void Add( Uri* uri, CookieCollection* cookies ); [JScript] public function Add( uri : Uri, cookies : CookieCollection );
- The URI of the CookieCollection to be added to the CookieContainer.
- The CookieCollection to be added to the CookieContainer.
|ArgumentNullException||uri is a null reference (Nothing in Visual Basic)|
|ArgumentNullException||cookies is a null reference (Nothing in Visual Basic)|
If your URI corresponds to your local domain and sends to all the hosts on the local domain, set the Cookie Domain property equal to ".local". Otherwise, make sure it matches the host name used in the URI.
If Count equals Capacity, one or more Cookie instances is 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 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