Freigeben über


ContextUtil.IsSecurityEnabled-Eigenschaft

Ruft einen Wert ab, der angibt, ob im aktuellen Kontext die rollenbasierte Sicherheit aktiviert ist.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

Syntax

'Declaration
Public Shared ReadOnly Property IsSecurityEnabled As Boolean
'Usage
Dim value As Boolean

value = ContextUtil.IsSecurityEnabled
public static bool IsSecurityEnabled { get; }
public:
static property bool IsSecurityEnabled {
    bool get ();
}
/** @property */
public static boolean get_IsSecurityEnabled ()
public static function get IsSecurityEnabled () : boolean

Eigenschaftenwert

true, wenn die Sicherheit im aktuellen Kontext aktiviert ist, andernfalls false.

Ausnahmen

Ausnahmetyp Bedingung

COMException

Es ist kein COM+-Kontext verfügbar.

Beispiel

Im folgenden Codebeispiel wird der Wert einer IsSecurityEnabled-Eigenschaft abgerufen.

<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 'Example
End Class '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 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 );
   }
};
/** @attribute SecurityRole("Role1")
 */
public class ContextUtil_IsSecurityEnabled extends 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}",
            System.Convert.ToString(ContextUtil.get_IsSecurityEnabled()));
    } //Example
} //ContextUtil_IsSecurityEnabled

.NET Framework-Sicherheit

  • Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ContextUtil-Klasse
ContextUtil-Member
System.EnterpriseServices-Namespace