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,则为该对象的 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

适用于