ProcessModelSection.ComImpersonationLevel 属性

定义

获取或设置一个值,该值指示 COM 安全性的身份验证级别。

public:
 property System::Web::Configuration::ProcessModelComImpersonationLevel ComImpersonationLevel { System::Web::Configuration::ProcessModelComImpersonationLevel get(); void set(System::Web::Configuration::ProcessModelComImpersonationLevel value); };
[System.Configuration.ConfigurationProperty("comImpersonationLevel", DefaultValue=System.Web.Configuration.ProcessModelComImpersonationLevel.Impersonate)]
public System.Web.Configuration.ProcessModelComImpersonationLevel ComImpersonationLevel { get; set; }
[<System.Configuration.ConfigurationProperty("comImpersonationLevel", DefaultValue=System.Web.Configuration.ProcessModelComImpersonationLevel.Impersonate)>]
member this.ComImpersonationLevel : System.Web.Configuration.ProcessModelComImpersonationLevel with get, set
Public Property ComImpersonationLevel As ProcessModelComImpersonationLevel

属性值

ProcessModelComImpersonationLevel

ProcessModelComImpersonationLevel 值之一。 默认值是 Impersonate

属性

示例

下面的代码示例演示如何访问 ComImpersonationLevel 属性。


// Get the current ComImpersonationLevel property value.
ProcessModelComImpersonationLevel comImpLevel = 
    processModelSection.ComImpersonationLevel;

// Set the ComImpersonationLevel property to
// ProcessModelComImpersonationLevel.Anonymous.
processModelSection.ComImpersonationLevel = 
    ProcessModelComImpersonationLevel.Anonymous;
' Get the current ComImpersonationLevel property value.
   Dim comImpLevel _
   As ProcessModelComImpersonationLevel = _
   processModelSection.ComImpersonationLevel

' Set the ComImpersonationLevel property to
' ProcessModelComImpersonationLevel.Anonymous.
   processModelSection.ComImpersonationLevel = _
   ProcessModelComImpersonationLevel.Anonymous

注解

当此属性值设置为 Default时,DCOM 使用其正常的安全协商算法确定模拟级别。 分配给此属性的默认值,如Machine.config文件中指定。Impersonate 在这种情况下,服务器进程可以模拟客户端的安全上下文,同时代表客户端执行操作。

适用于