通过


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,路径为 /asp。

适用于

另请参阅