ActivationArguments.ActivationContext 属性

定义

为应用程序获取基于清单的激活的激活上下文。

public:
 property ActivationContext ^ ActivationContext { ActivationContext ^ get(); };
public ActivationContext ActivationContext { get; }
member this.ActivationContext : ActivationContext
Public ReadOnly Property ActivationContext As ActivationContext

属性值

ActivationContext

一个对象,标识基于清单的激活应用程序。

示例

下面的代码示例演示如何从基于清单的应用程序获取ActivationArguments属性的值ActivationContext

此代码示例是为类提供的大型示例的 ActivationArguments 一部分。

// Get the ActivationArguments from the SetupInformation property of the domain.
ActivationArguments activationArgs = AppDomain.CurrentDomain.SetupInformation.ActivationArguments;
// Get the ActivationContext from the ActivationArguments.
ActivationContext actContext = activationArgs.ActivationContext;
Console.WriteLine("The ActivationContext.Form property value is: " +
    activationArgs.ActivationContext.Form);
Dim ac As ActivationContext = AppDomain.CurrentDomain.ActivationContext
' Get the ActivationArguments from the SetupInformation property of the domain.
Dim activationArgs As ActivationArguments = AppDomain.CurrentDomain.SetupInformation.ActivationArguments
' Get the ActivationContext from the ActivationArguments.
Dim actContext As ActivationContext = activationArgs.ActivationContext
Console.WriteLine("The ActivationContext.Form property value is: " + _
 activationArgs.ActivationContext.Form.ToString())

注解

ActivationContext 对象包含并 ApplicationIdentity 仅提供对应用程序清单的内部访问权限。 在基于清单的激活期间使用激活上下文来设置域策略并提供基于应用程序的安全模型。

适用于