RemotingConfiguration.GetRegisteredWellKnownServiceTypes 方法

检索对象类型的数组,这些对象类型在服务端上注册为已知类型。

**命名空间:**System.Runtime.Remoting
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Shared Function GetRegisteredWellKnownServiceTypes As WellKnownServiceTypeEntry()
用法
Dim returnValue As WellKnownServiceTypeEntry()

returnValue = RemotingConfiguration.GetRegisteredWellKnownServiceTypes
public static WellKnownServiceTypeEntry[] GetRegisteredWellKnownServiceTypes ()
public:
static array<WellKnownServiceTypeEntry^>^ GetRegisteredWellKnownServiceTypes ()
public static WellKnownServiceTypeEntry[] GetRegisteredWellKnownServiceTypes ()
public static function GetRegisteredWellKnownServiceTypes () : WellKnownServiceTypeEntry[]

返回值

对象类型的数组,这些对象类型在服务端上注册为已知类型。

异常

异常类型 条件

SecurityException

在调用堆栈上部,至少有一个调用方没有配置远程处理类型和通道的权限。

备注

已知对象类型可以是单个调用,也可以是 singleton。如果对象类型是单个调用,则每次传入来自客户端的调用时均将创建该对象类型的一个新实例。对 singleton 对象的所有调用均由该对象的一个实例来处理。

有关已知对象的更详细说明,请参见 服务器激活

示例

' 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())
// 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.
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 );

.NET Framework 安全性

平台

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 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

RemotingConfiguration 类
RemotingConfiguration 成员
System.Runtime.Remoting 命名空间
WellKnownServiceTypeEntry
WellKnownClientTypeEntry
RegisterWellKnownServiceType
RegisterWellKnownClientType