Edit

Share via


RemotingServices.GetObjectUri(MarshalByRefObject) Method

Definition

Retrieves the URI for the specified object.

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

Parameters

obj
MarshalByRefObject

The MarshalByRefObject for which a URI is requested.

Returns

The URI of the specified object if it has one, or null if the object has not yet been marshaled.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

//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

Applies to