RemotingConfiguration.IsWellKnownClientType 方法

定义

检查指定的对象类型是否注册为已知客户端类型。

重载

IsWellKnownClientType(Type)

检查指定的对象 Type 是否注册为已知客户端类型。

IsWellKnownClientType(String, String)

检查由其类型名称和程序集名称指定的对象是否注册为已知客户端类型。

IsWellKnownClientType(Type)

检查指定的对象 Type 是否注册为已知客户端类型。

public:
 static System::Runtime::Remoting::WellKnownClientTypeEntry ^ IsWellKnownClientType(Type ^ svrType);
public static System.Runtime.Remoting.WellKnownClientTypeEntry IsWellKnownClientType (Type svrType);
static member IsWellKnownClientType : Type -> System.Runtime.Remoting.WellKnownClientTypeEntry
Public Shared Function IsWellKnownClientType (svrType As Type) As WellKnownClientTypeEntry

参数

svrType
Type

要检查的对象 Type

返回

与指定的对象类型对应的 WellKnownClientTypeEntry

例外

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

示例

// Check whether the specified object type is registered as 
// well known client type or not.
WellKnownClientTypeEntry^ myWellKnownClientType = RemotingConfiguration::IsWellKnownClientType( MyServerImpl::typeid );
Console::WriteLine( "The Object type is {0}", myWellKnownClientType->ObjectType );
Console::WriteLine( "The Object Url is {0}", myWellKnownClientType->ObjectUrl );
// Check whether the specified object type is registered as
// well known client type or not.
WellKnownClientTypeEntry myWellKnownClientType =
    RemotingConfiguration.IsWellKnownClientType(typeof(MyServerImpl));
Console.WriteLine("The Object type is "
                  +myWellKnownClientType.ObjectType);
Console.WriteLine("The Object Url is "
                  +myWellKnownClientType.ObjectUrl);
' Check whether the specified object type is registered as 
' well known client type or not.
Dim myWellKnownClientType As WellKnownClientTypeEntry = _ 
                   RemotingConfiguration.IsWellKnownClientType(GetType(MyServerImpl))
Console.WriteLine("The Object type is " + myWellKnownClientType.ObjectType.ToString())
Console.WriteLine("The Object Url is " + myWellKnownClientType.ObjectUrl)

另请参阅

适用于

IsWellKnownClientType(String, String)

检查由其类型名称和程序集名称指定的对象是否注册为已知客户端类型。

public:
 static System::Runtime::Remoting::WellKnownClientTypeEntry ^ IsWellKnownClientType(System::String ^ typeName, System::String ^ assemblyName);
public static System.Runtime.Remoting.WellKnownClientTypeEntry IsWellKnownClientType (string typeName, string assemblyName);
static member IsWellKnownClientType : string * string -> System.Runtime.Remoting.WellKnownClientTypeEntry
Public Shared Function IsWellKnownClientType (typeName As String, assemblyName As String) As WellKnownClientTypeEntry

参数

typeName
String

要检查的对象的类型名称。

assemblyName
String

要检查的对象的程序集名称。

返回

与指定的对象类型对应的 WellKnownClientTypeEntry

例外

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

示例

MyServerImpl ^ myObject = gcnew MyServerImpl;

// Get the assembly for the 'MyServerImpl' object.
Assembly^ myAssembly = Assembly::GetAssembly( MyServerImpl::typeid );
AssemblyName^ myName = myAssembly->GetName();

// Check whether the specified object type is registered as
// well-known client type.
WellKnownClientTypeEntry^ myWellKnownClientType = RemotingConfiguration::IsWellKnownClientType( MyServerImpl::typeid->FullName, myName->Name );
Console::WriteLine( "The Object type :{0}", myWellKnownClientType->ObjectType );
Console::WriteLine( "The Object Uri :{0}", myWellKnownClientType->ObjectUrl );
 MyServerImpl myObject = new MyServerImpl();
 // Get the assembly for the 'MyServerImpl' object.
 Assembly myAssembly = Assembly.GetAssembly(typeof(MyServerImpl));
 AssemblyName myName = myAssembly.GetName();
// Check whether the specified object type is registered as
// well-known client type.
WellKnownClientTypeEntry myWellKnownClientType =
   RemotingConfiguration.IsWellKnownClientType(
                     (typeof(MyServerImpl)).FullName,myName.Name);
Console.WriteLine("The Object type :"
                +myWellKnownClientType.ObjectType);
Console.WriteLine("The Object Uri :"
                +myWellKnownClientType.ObjectUrl);
Dim myObject As New MyServerImpl()
' Get the assembly for the 'MyServerImpl' object.
Dim myAssembly As [Assembly] = [Assembly].GetAssembly(GetType(MyServerImpl))
Dim myName As AssemblyName = myAssembly.GetName()
' Check whether the specified object type is registered as
' well-known client type.
Dim myWellKnownClientType As WellKnownClientTypeEntry = _
     RemotingConfiguration.IsWellKnownClientType(GetType(MyServerImpl).FullName, myName.Name)
Console.WriteLine("The Object type :" + myWellKnownClientType.ObjectType.ToString())
Console.WriteLine("The Object Uri :" + myWellKnownClientType.ObjectUrl)

另请参阅

适用于