GetUrlsForObject Method

ChannelServices.GetUrlsForObject Method (MarshalByRefObject)


Returns an array of all the URLs that can be used to reach the specified object.

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

public static string[] GetUrlsForObject(
	MarshalByRefObject obj


Type: System.MarshalByRefObject

The object to retrieve the URL array for.

Return Value

Type: System.String[]

An array of strings that contains the URLs that can be used to remotely identify the object, or null if none were found.

Exception Condition

The immediate caller does not have infrastructure permission.

string[] myURLArray = ChannelServices.GetUrlsForObject(myHelloServer);
Console.WriteLine("Number of URLs for the specified Object: "
for (int iIndex=0; iIndex<myURLArray.Length; iIndex++)
   Console.WriteLine("URL: "+myURLArray[iIndex]);


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

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft