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"
 

備註

屬性 PathDomain 擴充 屬性,以完整描述 Cookie 套用的特定 URL。 例如,在 URL http:/www.microsoft.com/asp 中,網域為 www.microsoft.com ,而路徑為 /asp。

適用於

另請參閱