CookieContainer.GetCookies Method (Uri)

 

Gets a CookieCollection that contains the Cookie instances that are associated with a specific URI.

Namespace:   System.Net
Assembly:  System (in System.dll)

public CookieCollection GetCookies(
	Uri uri
)

Parameters

uri
Type: System.Uri

The URI of the Cookie instances desired.

Return Value

Type: System.Net.CookieCollection

A CookieCollection that contains the Cookie instances that are associated with a specific URI.

Exception Condition
ArgumentNullException

uri is null.

A new instance of a CookieCollection is created. Then the Cookie instances in the internal collection that are associated with the specified URI are read out and added to the new CookieCollection.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: