次の方法で共有


RemotingServices.GetServerTypeForUri メソッド

指定した URI を持つオブジェクトの Type を返します。

Public Shared Function GetServerTypeForUri( _
   ByVal URI As String _) As Type
[C#]
public static Type GetServerTypeForUri(stringURI);
[C++]
public: static Type* GetServerTypeForUri(String* URI);
[JScript]
public static function GetServerTypeForUri(
   URI : String) : Type;

パラメータ

  • URI
    Type が要求されるオブジェクトの URI。

戻り値

指定した URI を持つオブジェクトの Type

例外

例外の種類 条件
SecurityException 直前の呼び出し元にインフラストラクチャ アクセス許可がありません。または、コールスタックの上位にある 1 つ以上の呼び出し元に非パブリック メンバの型情報を取得するためのアクセス許可がありません。

解説

リモート処理では URI を使用してエンドポイントを識別するため、 IMessage オブジェクトを使用するリモート処理インフラストラクチャのプラグ可能な部分 (チャネル シンク、動的シンク、およびコンテキスト シンク) で、 GetServerTypeForUri メソッドが役に立ちます。これは、現在のメソッドが、関連付けられた型のオブジェクトを URI から返すためです。

使用例

 
Console.WriteLine("Server type: {0}", _
                  RemotingServices.GetServerTypeForUri(myObjectUri).ToString())

[C#] 
Console.WriteLine("Server type: {0}",
                  RemotingServices.GetServerTypeForUri(myObjectUri));

[C++] 
Console::WriteLine(S"Server type: {0}", RemotingServices::GetServerTypeForUri(const_cast<String*>(myObjectUri)));

[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 セキュリティ:

参照

RemotingServices クラス | RemotingServices メンバ | System.Runtime.Remoting 名前空間