Share via


ContextUtil.IsSecurityEnabled Özellik

Tanım

Rol tabanlı güvenliğin geçerli bağlamda etkin olup olmadığını gösteren bir değer alır.

public:
 static property bool IsSecurityEnabled { bool get(); };
public static bool IsSecurityEnabled { get; }
static member IsSecurityEnabled : bool
Public Shared ReadOnly Property IsSecurityEnabled As Boolean

Özellik Değeri

true geçerli bağlamda güvenlik etkinse; aksi takdirde , false.

Özel durumlar

Kullanılabilir COM+ bağlamı yoktur.

Örnekler

Aşağıdaki kod örneği bir IsSecurityEnabled özelliğin değerini alır.

[SecurityRole("Role1")]
public ref class ContextUtil_IsSecurityEnabled: public ServicedComponent
{
public:
   void Example()
   {
      // Display whether role-based security is active for the current COM+
      // context.
      Console::WriteLine( "Role-based security active in current context: {0}", 
         ContextUtil::IsSecurityEnabled );
   }
};
[SecurityRole("Role1")]
public class ContextUtil_IsSecurityEnabled : ServicedComponent
{
    public void Example()
    {
        // Display whether role-based security is active for the current COM+
        // context.
        Console.WriteLine("Role-based security active in current context: {0}",
            ContextUtil.IsSecurityEnabled);
    }
}
<SecurityRole("Role1")>  _
Public Class ContextUtil_IsSecurityEnabled
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display whether role-based security is active for the current COM+
        ' context.
        MsgBox("Role-based security active in current context: " & ContextUtil.IsSecurityEnabled)

    End Sub
End Class

Şunlara uygulanır