Freigeben über


RemotingConfiguration.IsActivationAllowed-Methode

Gibt einen booleschen Wert zurück, der angibt, ob für den angegebenen Type eine Aktivierung durch den Client zulässig ist.

Namespace: System.Runtime.Remoting
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Function IsActivationAllowed ( _
    svrType As Type _
) As Boolean
'Usage
Dim svrType As Type
Dim returnValue As Boolean

returnValue = RemotingConfiguration.IsActivationAllowed(svrType)
public static bool IsActivationAllowed (
    Type svrType
)
public:
static bool IsActivationAllowed (
    Type^ svrType
)
public static boolean IsActivationAllowed (
    Type svrType
)
public static function IsActivationAllowed (
    svrType : Type
) : boolean

Parameter

  • svrType
    Der zu überprüfende Objekt-Type.

Rückgabewert

true, wenn für den angegebenen Type eine Aktivierung durch den Client zulässig ist, andernfalls false.

Ausnahmen

Ausnahmetyp Bedingung

SecurityException

Mindestens einer der Aufrufer an höherer Position im Aufrufstapel verfügt nicht über die Berechtigung zum Konfigurieren von Remotetypen und Channels.

Hinweise

Auf der Serverseite wird mithilfe der aktuellen Methode bestimmt, ob eine Aktivierung des Objekt-Type vom Server explizit zugelassen ist.

Beispiel

' Check whether the 'MyServerImpl' object is allowed for activation or not.
If RemotingConfiguration.IsActivationAllowed(GetType(MyServerImpl)) Then
   ' Get the registered activated service types .
   Dim myActivatedServiceEntries As ActivatedServiceTypeEntry() = _ 
                       RemotingConfiguration.GetRegisteredActivatedServiceTypes()
   Console.WriteLine("The Length of the registered activated service type array is " + _ 
                                  myActivatedServiceEntries.Length.ToString())
   Console.WriteLine("The Object type is:" + _ 
                           myActivatedServiceEntries(0).ObjectType.ToString())
End If
// Check whether the 'MyServerImpl' object is allowed for 
// activation or not.
if(RemotingConfiguration.IsActivationAllowed(typeof(MyServerImpl)))
{
 // Get the registered activated service types .
 ActivatedServiceTypeEntry[] myActivatedServiceEntries =
       RemotingConfiguration.GetRegisteredActivatedServiceTypes();
Console.WriteLine("The Length of the registered activated service"
                 +" type array is "+myActivatedServiceEntries.Length);
Console.WriteLine("The Object type is:"
                    +myActivatedServiceEntries[0].ObjectType);
}
// Check whether the 'MyServerImpl' object is allowed for 
// activation or not.
if ( RemotingConfiguration::IsActivationAllowed( MyServerImpl::typeid ) )
{
   // Get the registered activated service types .
   array<ActivatedServiceTypeEntry^>^myActivatedServiceEntries = RemotingConfiguration::GetRegisteredActivatedServiceTypes();
   Console::WriteLine( "The Length of the registered activated service type array is {0}", myActivatedServiceEntries->Length );
   Console::WriteLine( "The Object type is:{0}", myActivatedServiceEntries[ 0 ]->ObjectType );
}
// Check whether the 'MyServerImpl' object is allowed for 
// activation or not.
if (RemotingConfiguration.IsActivationAllowed(MyServerImpl.
    class.ToType())) {
    // Get the registered activated service types .
    ActivatedServiceTypeEntry myActivatedServiceEntries[] = 
        RemotingConfiguration.GetRegisteredActivatedServiceTypes();
    Console.WriteLine("The Length of the registered activated service"
        + " type array is " + myActivatedServiceEntries.get_Length());
    Console.WriteLine("The Object type is:"
        + myActivatedServiceEntries[0].get_ObjectType());
}

.NET Framework-Sicherheit

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, 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

RemotingConfiguration-Klasse
RemotingConfiguration-Member
System.Runtime.Remoting-Namespace