HttpServerChannel.GetUrlsForUri(String) Method

Definition

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

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

Implements

Examples

The following code example shows how to use the GetUrlsForUri method. This code example is part of a larger example provided for the HttpServerChannel class.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Http;

class Class1 {
   public static void Main() {

      // Create a remotable object.
      HttpChannel httpChannel = new HttpChannel(8085);

      WellKnownServiceTypeEntry WKSTE =
         new WellKnownServiceTypeEntry(typeof(HelloService),
                                       "Service",
                                       WellKnownObjectMode.Singleton);
      RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);

      RemotingConfiguration.ApplicationName = "HelloServer";

      // Print out the urls for HelloServer.
      string[] urls = httpChannel.GetUrlsForUri("HelloServer");

      foreach (string url in urls)
         System.Console.WriteLine("{0}", url);
   }
}

public class HelloService : MarshalByRefObject{
}

Remarks

The current method is used by ChannelServices.GetUrlsForObject.

Applies to

מוצר גירסאות
.NET Framework 1.1, 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