RemotingServices.GetObjectUri(MarshalByRefObject) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
擷取指定物件的 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
參數
用來要求 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