RemotingServices.GetObjectUri Method (MarshalByRefObject)

 

Retrieves the URI for the specified object.

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

<SecurityCriticalAttribute>
Public Shared Function GetObjectUri (
	obj As MarshalByRefObject
) As String

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

SecurityPermission

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

.NET Framework
Available since 1.1
Return to top
Show: