共用方式為


RemotingConfiguration.GetRegisteredWellKnownServiceTypes 方法

定義

擷取登錄在服務端做為已知型別的物件型別陣列。

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

傳回

登錄在服務端做為已知型別的物件型別陣列。

例外狀況

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

範例

// Retrive the array of objects registered as well known types at
// the service end.
array<WellKnownServiceTypeEntry^>^myEntries = RemotingConfiguration::GetRegisteredWellKnownServiceTypes();
Console::WriteLine( "The number of WellKnownServiceTypeEntries are:{0}", myEntries->Length );
Console::WriteLine( "The Object Type is:{0}", myEntries[ 0 ]->ObjectType );
Console::WriteLine( "The Object Uri is:{0}", myEntries[ 0 ]->ObjectUri );
Console::WriteLine( "The Mode is:{0}", myEntries[ 0 ]->Mode );

// Retrive the array of objects registered as well known types at
// the service end.
WellKnownServiceTypeEntry[] myEntries =
          RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
Console.WriteLine("The number of WellKnownServiceTypeEntries are:"
                              +myEntries.Length);
Console.WriteLine("The Object Type is:"+myEntries[0].ObjectType);
Console.WriteLine("The Object Uri is:"+myEntries[0].ObjectUri);
Console.WriteLine("The Mode is:"+myEntries[0].Mode);

' Retrive the array of objects registered as well known types at
' the service end.
Dim myEntries As WellKnownServiceTypeEntry() = _ 
                 RemotingConfiguration.GetRegisteredWellKnownServiceTypes()
Console.WriteLine("The number of WellKnownServiceTypeEntries are:" + myEntries.Length.ToString())
Console.WriteLine("The Object Type is:" + myEntries(0).ObjectType.ToString())
Console.WriteLine("The Object Uri is:" + myEntries(0).ObjectUri)
Console.WriteLine("The Mode is:" + myEntries(0).Mode.ToString())

備註

已知的物件類型可以是單一呼叫或單一呼叫。 如果物件類型是單一呼叫,則每次用戶端呼叫時都會建立它的新實例。 單一物件的所有呼叫都會由該物件的一個實例處理。

如需已知對象的詳細描述,請參閱 伺服器啟用

適用於

另請參閱