HttpCookieManager.GetCookies(Uri) Method

Definition

Gets an HttpCookieCollection that contains the HttpCookie instances that are associated with a specific URI.

public:
 virtual HttpCookieCollection ^ GetCookies(Uri ^ uri) = GetCookies;
HttpCookieCollection GetCookies(Uri const& uri);
public HttpCookieCollection GetCookies(System.Uri uri);
function getCookies(uri)
Public Function GetCookies (uri As Uri) As HttpCookieCollection

Parameters

uri
Uri Uri

The URI of the HttpCookie instances desired.

Returns

The HttpCookieCollection that contains the HttpCookie instances that are associated with a specific URI.

Remarks

The GetCookies method creates a new instance of an HttpCookieCollection. Then the HttpCookie instances in the internal collection that are associated with the specified URI are read out and added to the new HttpCookieCollection.

Below are the exceptions that this function throws.

E_INVALIDARG

The uri parameter was a null reference (Nothing in Visual Basic).

Applies to