IpcServerChannel.GetUrlsForUri(String) 方法

定義

傳回具有指定 URI 之物件的所有 URL 陣列,裝載於目前 IpcChannel 執行個體上。

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

參數

objectUri
String

其 URL 被要求之物件的 URI。

傳回

String[]

具有指定 URI 之物件的 URL 陣列,裝載於目前 TcpChannel 執行個體上。

實作

範例

下列程式碼範例示範如何使用 GetUrlsForUri 方法。

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);
}

備註

此方法是由 ChannelServices.GetUrlsForObject 方法使用。

適用於

產品 版本
.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