ServiceAuthorizationBehavior 构造函数

定义

初始化 ServiceAuthorizationBehavior 类的新实例。

public:
 ServiceAuthorizationBehavior();
public ServiceAuthorizationBehavior ();
Public Sub New ()

示例

下面的代码演示如何检索此类的实例。

// Code to create a ServiceHost not shown.
ServiceAuthorizationBehavior MyServiceAuthoriationBehavior =
    serviceHost.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
MyServiceAuthoriationBehavior.ImpersonateCallerForAllOperations = true;
' Code to create a ServiceHost not shown.
Dim MyServiceAuthoriationBehavior As ServiceAuthorizationBehavior 
MyServiceAuthoriationBehavior= serviceHost.Description.Behaviors.Find _
(Of ServiceAuthorizationBehavior)()
MyServiceAuthoriationBehavior.ImpersonateCallerForAllOperations = True

注解

通常,应用程序不直接调用构造函数。 而是通过调用 ServiceHostBase.Description.Behaviors.Find<ServiceAuthorizationBehavior> 来检索此类的实例。

适用于