語言

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: 請求標頭中的字串表示。

範例

以下範例顯示回應中回傳的 cookie 字串值。 完整範例請參見 Cookie 課程主題。

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

備註

字串的確切格式取決於該 cookie 所遵循的 RFC。

適用於