Export (0) Print
Expand All

CookieContainer.GetCookieHeader Method

Gets the HTTP cookie header containing the HTTP cookies representing the Cookie instances associated with a specific URI.

[Visual Basic]
Public Function GetCookieHeader( _
   ByVal uri As Uri _
) As String
[C#]
public string GetCookieHeader(
 Uri uri
);
[C++]
public: String* GetCookieHeader(
 Uri* uri
);
[JScript]
public function GetCookieHeader(
   uri : Uri
) : String;

Parameters

uri
The URI of the Cookie instances desired.

Return Value

An HTTP cookie header, with strings representing Cookie instances delimited by semicolons.

Exceptions

Exception Type Condition
ArgumentNullException uri is a null reference (Nothing in Visual Basic)

Remarks

GetCookieHeader returns a string that holds the HTTP cookie header for the Cookie instances specified by uri. The HTTP header is built by adding a string representation of each Cookie associated with uri. Note the exact format of the string depends on the RFC the Cookie conforms to. The strings for all the Cookie instances associated with uri are combined and delimited by semicolons.

This string is not in the correct format for use as the second parameter of the SetCookies method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CookieContainer Class | CookieContainer Members | System.Net Namespace | Cookie | CookieCollection | CookieContainer | CookieException

Show:
© 2014 Microsoft