共用方式為


HttpCookie.Path 屬性

定義

取得或設定虛擬路徑以目前的 Cookie 傳輸。

public:
 property System::String ^ Path { System::String ^ get(); void set(System::String ^ value); };
public string Path { get; set; }
member this.Path : string with get, set
Public Property Path As String

屬性值

透過 cookie 傳送的虛擬路徑。 預設是 /,也就是伺服器根節點。

範例

以下程式碼範例設定 Path 新 Cookie 的屬性。

MyCookie.Path = "/asp";

MyCookie.Path = "/asp"
 

備註

Path 屬性擴展該 Domain 屬性,完全描述 Cookie 所適用的特定 URL。 例如,在 URL http:/www.microsoft.com/asp中,網域是 www.microsoft.com ,路徑是 /asp。

適用於

另請參閱