Cookie.ToString 方法

定義

覆寫 ToString() 方法。

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

傳回

傳回這個 Cookie 物件的字串表示,以用來含入 HTTP Cookie: request 標頭。

範例

下列範例會顯示回應中傳回之 Cookie 的字串值。 如需完整的範例,請參閱 Cookie 類別主題。

// Show the string representation of the cookie.
Console::WriteLine( "String: {0}", cook );
// Show the string representation of the cookie.
Console.WriteLine($"String: {cook}");
' Show the string representation of the cookie.
Console.WriteLine($"String: {cook}")

備註

字串的確切格式取決於此 Cookie 符合的 RFC。

適用於