FormsAuthenticationConfiguration.Path 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 cookie 路徑。
public:
property System::String ^ Path { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("path", DefaultValue="/")]
[System.Configuration.StringValidator(MinLength=1)]
public string Path { get; set; }
[<System.Configuration.ConfigurationProperty("path", DefaultValue="/")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Path : string with get, set
Public Property Path As String
屬性值
HTTP Cookie 用於認證的路徑。 預設值為斜杠(/),代表網頁應用程式的根節點。
- 屬性
範例
以下程式碼範例說明如何存取該 Path 物業。 參考課堂主題中的 FormsAuthenticationConfiguration 程式碼範例,了解如何取得該章節。
// Get the current Path.
string currentPath = formsAuthentication.Path;
// Set the Path property.
formsAuthentication.Path = "newPath";
' Get the current Path.
Dim currentPath As String = formsAuthentication.Path
' Set the Path property.
formsAuthentication.Path = "newPath"
備註
該 Path 屬性表示認證 Cookie 所在位置,並與認證 Cookie 一同傳送。