PassportAuthentication 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.
在 ASP.NET 应用程序中配置基于密码的身份验证。
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
配置文件中的节点。
此类型是包含 、 FormsAuthenticationConfiguration和 AuthenticationMode 类型的组的AuthenticationSection一部分。
注意
类 PassportAuthentication 只能在计算机、站点或应用程序级别将信息写入配置文件的相关部分。 在层次结构中不同级别的配置文件中写入的任何尝试都将导致分析程序生成的错误消息。 可以使用此类读取层次结构中任何级别的配置信息。
构造函数
PassportAuthentication() |
已过时.
初始化 PassportAuthentication 类的新实例。 |