语言

IdentitySection.Impersonate 属性

定义

获取或设置一个值,该值指示是否对每个请求使用客户端模拟。

public:
 property bool Impersonate { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("impersonate", DefaultValue=false)]
public bool Impersonate { get; set; }
[<System.Configuration.ConfigurationProperty("impersonate", DefaultValue=false)>]
member this.Impersonate : bool with get, set
Public Property Impersonate As Boolean

属性值

true 如果使用客户端模拟,则为否则,为 false. 默认值为 false。

属性

示例

下面的代码示例演示如何访问 Impersonate 属性。 请参阅该类的 IdentitySection 代码示例,了解如何访问该部分。

// Get the Impersonate property value.
bool currentImpersonate = identitySection.Impersonate;

// Set the Impersonate property to true.
identitySection.Impersonate = true;
' Get the Impersonate property value.
Dim currentImpersonate As Boolean = identitySection.Impersonate

' Set the Impersonate property to true.
identitySection.Impersonate = True

注解

Impersonate如果该属性设置为true,则每个请求由模拟其客户端的 Web 应用程序提供。 也就是说,当前登录的用户或由 UserName 属性 Password 指定的用户。 当属性 Impersonate 设置为 false时,应用程序不会模拟任何客户端用户。

注释

出于安全原因,标识部分支持存储加密 UserName 和 Password。

适用于

另请参阅