型名とアセンブリ名で指定したオブジェクトが、既知のクライアント型として登録されているかどうかを確認します。
Overloads Public Shared Function IsWellKnownClientType( _
ByVal typeName As String, _ ByVal assemblyName As String _) As WellKnownClientTypeEntry
[C#]
public static WellKnownClientTypeEntry IsWellKnownClientType(stringtypeName,stringassemblyName);
[C++]
public: static WellKnownClientTypeEntry* IsWellKnownClientType(String* typeName,String* assemblyName);
[JScript]
public static function IsWellKnownClientType(
typeName : String,assemblyName : String) : WellKnownClientTypeEntry;
パラメータ
- typeName
確認する対象のオブジェクトの型名。 - assemblyName
確認する対象のオブジェクトのアセンブリ名。
戻り値
指定したオブジェクト型に対応している WellKnownClientTypeEntry 。
例外
例外の種類 | 条件 |
---|---|
SecurityException | コールスタックの上位にある 1 つ以上の呼び出し元に、リモート処理の型とチャネルを構成するためのアクセス許可がありません。 |
使用例
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)
[C#]
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);
[C++]
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(S"The Object type :{0}", myWellKnownClientType->ObjectType);
Console::WriteLine(S"The Object Uri :{0}", myWellKnownClientType->ObjectUrl);
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- SecurityPermission (リモート処理インフラストラクチャを構成するために必要なアクセス許可)要求値: SecurityAction.Demand; アクセス許可値: SecurityPermissionFlag.RemotingConfiguration
参照
RemotingConfiguration クラス | RemotingConfiguration メンバ | System.Runtime.Remoting 名前空間 | RemotingConfiguration.IsWellKnownClientType オーバーロードの一覧 | サーバー アクティベーション