RemotingConfiguration.GetRegisteredActivatedServiceTypes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
擷取登錄在服務端可從用戶端要求啟動的物件型別陣列。
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
備註
如需客戶端啟動物件的詳細說明,請參閱 客戶端啟用。