IdentitySection 类
指定 ASP.NET 应用程序是否应作为应用程序池标识(默认)、经过 IIS 身份验证的用户标识或自定义配置的标识运行。
语法
class IdentitySection : ConfigurationSection
方法
下表列出了 IdentitySection
类公开的方法。
名称 | 描述 |
---|---|
GetAllowDefinition | (继承自 ConfigurationSection。) |
GetAllowLocation | (从 ConfigurationSection 继承。) |
RevertToParent | (从 ConfigurationSection 继承。) |
SetAllowDefinition | (从 ConfigurationSection 继承。) |
SetAllowLocation | (从 ConfigurationSection 继承。) |
属性
下表列出了 IdentitySection
类公开的属性。
名称 | 描述 |
---|---|
Impersonate |
一个必需的读/写 boolean 值。 如果在每个请求上使用客户端模拟,则为 true ;否则为 false 。 默认为 false 。 |
Location |
(继承自 ConfigurationSection 。)一个键属性。 |
Password |
一个可选的读/写 string 值,指定 Web 应用程序的密码(如果 Impersonate 属性设置为 true )。 有关详细信息,请参阅“备注”部分。 |
Path |
(继承自 ConfigurationSection 。)一个键属性。 |
SectionInformation |
(从 ConfigurationSection 继承。) |
UserName |
一个可选的读/写 string 值,指定 Web 应用程序的用户名(如果 Impersonate 属性设置为 true )。 有关详细信息,请参阅“备注”部分。 |
子类
此类不包含子类。
注解
Password
和 UserName
属性以明文形式存储在配置文件中。 尽管 IIS 不会传输 .config 文件来响应用户代理请求,但在服务器所在域中具有适当凭据的用户可以读取 .config 文件。 有关在注册表中以加密形式存储 UserName
和 Password
值的信息,请参见 identity 元素(ASP.NET 设置架构)。
继承层次结构
IdentitySection
要求
类型 | 描述 |
---|---|
客户端 | - Windows Vista 上的 IIS 7.0 - Windows 7 上的 IIS 7.5 - Windows 8 上的 IIS 8.0 - Windows 10 上的 IIS 10.0 |
服务器 | - Windows Server 2008 上的 IIS 7.0 - Windows Server 2008 R2 上的 IIS 7.5 - Windows Server 2012 上的 IIS 8.0 - Windows Server 2012 R2 上的 IIS 8.5 - Windows Server 2016 上的 IIS 10.0 |
产品 | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 |
MOF 文件 | WebAdministration.mof |