語言

RemotingServices.GetServerTypeForUri(String) 方法

定義

回傳 Type 帶有指定 URI 的物件。

public:
 static Type ^ GetServerTypeForUri(System::String ^ URI);
public static Type GetServerTypeForUri(string URI);
[System.Security.SecurityCritical]
public static Type GetServerTypeForUri(string URI);
static member GetServerTypeForUri : string -> Type
[<System.Security.SecurityCritical>]
static member GetServerTypeForUri : string -> Type
Public Shared Function GetServerTypeForUri (URI As String) As Type

參數

URI
String

請求對象的 Type URI。

傳回

是 Type 物件中指定的 URI。

屬性

例外狀況

要麼直接呼叫者沒有基礎設施權限,要麼至少有一個呼叫堆疊中較上層的呼叫者沒有權限取得非公開成員的類型資訊。

範例

Console::WriteLine( "Server type: {0}", RemotingServices::GetServerTypeForUri( const_cast<String^>(myObjectUri) ) );
Console.WriteLine("Server type: {0}",
                  RemotingServices.GetServerTypeForUri(myObjectUri));
Console.WriteLine("Server type: {0}", _
                  RemotingServices.GetServerTypeForUri(myObjectUri).ToString())

備註

由於遠端處理是透過 URI 來識別端點,此 GetServerTypeForUri 方法在遠端 IMessage 通訊基礎設施中可插拔的部分(例如通道匯、動態匯款和上下文匯)中非常有用,因為目前的方法會從 URI 回傳相關的型別物件。

適用於