PassportAuthentication 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.
在 ASP.NET 應用程式中設定 Passport 驗證。
public ref class PassportAuthentication sealed : System::Configuration::ConfigurationElement
public sealed class PassportAuthentication : System.Configuration.ConfigurationElement
[System.Obsolete("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
public sealed class PassportAuthentication : System.Configuration.ConfigurationElement
type PassportAuthentication = class
inherit ConfigurationElement
[<System.Obsolete("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")>]
type PassportAuthentication = class
inherit ConfigurationElement
Public NotInheritable Class PassportAuthentication
Inherits ConfigurationElement
- 繼承
- 屬性
範例
下列程式代碼範例示範如何從現有 Web 應用程式的組態檔取得 PassportAuthentication 物件。 此外,也會顯示組態範例。
<authentication>
<passport redirectUrl="Login.aspx"/>
</authentication>
// Get the configuration.
// Get the Web application configuration.
System.Configuration.Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
System.Web.Configuration.AuthenticationSection authenticationSection = (System.Web.Configuration.AuthenticationSection)configuration.GetSection("system.web/authentication");
// Get the authentication passport element.
PassportAuthentication passport = authenticationSection.Passport;
' Get the configuration.
Dim configuration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
' Get the authentication section.
Dim authenticationSection As System.Web.Configuration.AuthenticationSection = CType(configuration.GetSection("system.web/authentication"), System.Web.Configuration.AuthenticationSection)
' Get the authentication passport element.
Dim passport As PassportAuthentication = authenticationSection.Passport
備註
類別 PassportAuthentication 可讓您存取和設定 標籤所識別 Machine.config 或 Web.config 組態檔中的 passport
節點。
此類型是包含 AuthenticationSection、 FormsAuthenticationConfiguration和 AuthenticationMode 類型的群組的一部分。
注意
類別 PassportAuthentication 只能在計算機、月臺或應用層級將資訊寫入組態檔的相關區段中。 任何嘗試在階層中位於不同層級的組態檔中寫入,都會導致剖析器所產生的錯誤訊息。 您可以使用這個類別來讀取階層中任何層級的組態資訊。
建構函式
PassportAuthentication() |
已淘汰.
初始化 PassportAuthentication 類別的新執行個體。 |