共用方式為


RemotingServices.GetObjectUri(MarshalByRefObject) 方法

定義

擷取指定物件的 URI。

public:
 static System::String ^ GetObjectUri(MarshalByRefObject ^ obj);
public static string GetObjectUri (MarshalByRefObject obj);
[System.Security.SecurityCritical]
public static string GetObjectUri (MarshalByRefObject obj);
static member GetObjectUri : MarshalByRefObject -> string
[<System.Security.SecurityCritical>]
static member GetObjectUri : MarshalByRefObject -> string
Public Shared Function GetObjectUri (obj As MarshalByRefObject) As String

參數

obj
MarshalByRefObject

用來要求 URI 的 MarshalByRefObject

傳回

指定物件的 URI (如果有的話) 或 null (如果尚未封送處理物件)。

屬性

例外狀況

立即呼叫端沒有基礎結構使用權限。

範例

//GetRealProxy, GetObjectUri, GetEnvoyChainForProxy
RealProxy^ proxy = RemotingServices::GetRealProxy( obj );
Console::WriteLine( "Real proxy type: {0}", proxy->GetProxiedType() );
Console::WriteLine( "Object URI: {0}", RemotingServices::GetObjectUri( obj ) );
IMessageSink^ msgSink = RemotingServices::GetEnvoyChainForProxy( obj )->NextSink;
// GetRealProxy, GetObjectUri, GetEnvoyChainForProxy
RealProxy proxy = RemotingServices.GetRealProxy(obj);
Console.WriteLine("Real proxy type: {0}", proxy.GetProxiedType().ToString());

Console.WriteLine("Object URI: {0}", RemotingServices.GetObjectUri(obj).ToString());

IMessageSink  msgSink = RemotingServices.GetEnvoyChainForProxy(obj).NextSink;
' GetRealProxy, GetObjectUri, GetEnvoyChainForProxy
Dim proxy As RealProxy = RemotingServices.GetRealProxy(obj)
Console.WriteLine("Real proxy type: {0}", proxy.GetProxiedType().ToString())

Console.WriteLine("Object URI: {0}", RemotingServices.GetObjectUri(obj).ToString())

Dim msgSink As IMessageSink = RemotingServices.GetEnvoyChainForProxy(obj).NextSink

適用於