次の方法で共有


CookieContainer.GetCookieHeader Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the HTTP cookie header that contains cookies pertaining to the specified Uniform Resource Identifier (URI).

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

Syntax

'Declaration
Public Function GetCookieHeader ( _
    uri As Uri _
) As String
public string GetCookieHeader(
    Uri uri
)

Parameters

  • uri
    Type: System.Uri
    The URI to retrieve cookies for.

Return Value

Type: System.String
A string representing the cookie header associated with the specified URI.

Exceptions

Exception Condition
ArgumentNullException

uri is nulla null reference (Nothing in Visual Basic).

Remarks

The HTTP cookie header is created by adding a string representation of each cookie associated with the specified URI; seperating each cookie in the string with a semicolon. The exact format of each cookie string depends on the RFC the cookie conforms to.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.