TcpChannel.Parse(String, String) Método

Definição

Extrai o URI do canal e o URI remoto do objeto conhecido a partir da URL especificada.

public:
 virtual System::String ^ Parse(System::String ^ url, [Runtime::InteropServices::Out] System::String ^ % objectURI);
public string Parse(string url, out string objectURI);
abstract member Parse : string * string -> string
override this.Parse : string * string -> string
Public Function Parse (url As String, ByRef objectURI As String) As String

Parâmetros

url
String

A URL de onde extrair o URI do objeto remoto bem conhecido.

objectURI
String

Quando este método regressa, contém um String que contém o URI do objeto remoto bem conhecido. Este parâmetro é passado sem inicializar.

Devoluções

O URI do canal atual.

Implementações

Exemplos

O seguinte exemplo de código mostra como usar este método.

// Parse the channel's URI.
array<String^>^ urls = serverChannel->GetUrlsForUri("RemoteObject.rem");
if (urls->Length > 0)
{
    String^ objectUrl = urls[0];
    String^ objectUri;
    String^ channelUri = serverChannel->Parse(objectUrl, objectUri);
    Console::WriteLine("The object URL is {0}.", objectUrl);
    Console::WriteLine("The object URI is {0}.", objectUri);
    Console::WriteLine("The channel URI is {0}.", channelUri);
}
// 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 URL is {0}.", objectUrl);
    Console.WriteLine("The object URI is {0}.", objectUri);
    Console.WriteLine("The channel URI is {0}.", channelUri);
}

Observações

Um URI de um objeto é um valor que identifica de forma única uma instância específica de um objeto.

Aplica-se a

Ver também