RemotingServices::GetObjectUri Method (MarshalByRefObject^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Retrieves the URI for the specified object.

Namespace:   System.Runtime.Remoting
Assembly:  mscorlib (in mscorlib.dll)

public:
[SecurityCriticalAttribute]
static String^ GetObjectUri(
	MarshalByRefObject^ obj
)

Parameters

obj
Type: System::MarshalByRefObject^

The MarshalByRefObject for which a URI is requested.

Return Value

Type: System::String^

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

Exception Condition
SecurityException

The immediate caller does not have infrastructure permission.

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

SecurityPermission

for operating with infrastructure code. Demand value: SecurityAction::LinkDemand; Permission value: SecurityPermissionFlag::Infrastructure

.NET Framework
Available since 1.1
Return to top
Show: