共用方式為


RemotingConfiguration.GetRegisteredActivatedServiceTypes 方法

定義

擷取登錄在服務端可從用戶端要求啟動的物件型別陣列。

public:
 static cli::array <System::Runtime::Remoting::ActivatedServiceTypeEntry ^> ^ GetRegisteredActivatedServiceTypes();
public static System.Runtime.Remoting.ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes ();
static member GetRegisteredActivatedServiceTypes : unit -> System.Runtime.Remoting.ActivatedServiceTypeEntry[]
Public Shared Function GetRegisteredActivatedServiceTypes () As ActivatedServiceTypeEntry()

傳回

登錄在服務端可從用戶端要求啟動的物件型別陣列。

例外狀況

至少有一個呼叫堆疊中較高的呼叫端,不具有設定遠端類型和通道的使用權限。

範例

// 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(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(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

備註

如需客戶端啟動物件的詳細說明,請參閱 客戶端啟用

適用於

另請參閱