RemotingConfiguration.IsWellKnownClientType 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
檢查指定物件型別是否登錄為已知用戶端型別。
多載
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
參數
傳回
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)