IpcServerChannel.GetUrlsForUri(String) Method

Definition

Returns an array of all the URLs for the object with the specified URI, hosted on the current IpcChannel instance.

C#
public virtual string[] GetUrlsForUri(string objectUri);

Parameters

objectUri
String

The URI of the object for which URLs are required.

Returns

String[]

An array of the URLs for an object with the specified URI, hosted on the current TcpChannel instance.

Implements

Examples

The following code example shows how to use the GetUrlsForUri method.

C#
// Parse the channel's URI.
string[] urls = serverChannel.GetUrlsForUri("RemoteObject.rem");
if (urls.Length > 0)
{
    string objectUrl = urls[0];
    string objectUri;
    string channelUri = serverChannel.Parse(objectUrl, out objectUri);
    Console.WriteLine("The object URI is {0}.", objectUri);
    Console.WriteLine("The channel URI is {0}.", channelUri);
    Console.WriteLine("The object URL is {0}.", objectUrl);
}

Remarks

This method is used by the ChannelServices.GetUrlsForObject method.

Applies to

產品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1