Udostępnij za pośrednictwem


HttpChannel.Parse(String, String) Metoda

Definicja

Wyodrębnia identyfikator URI kanału i zdalny dobrze znany identyfikator URI obiektu z określonego adresu URL.

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

Parametry

url
String

Adres URL, z którego ma wyodrębnić identyfikator URI zdalnego dobrze znanego obiektu.

objectURI
String

Gdy ta metoda zostanie zwrócona, zawiera String identyfikator URI zdalnego dobrze znanego obiektu. Ten parametr jest przekazywany jako niezainicjowany.

Zwraca

Identyfikator URI bieżącego kanału lub null jeśli określony adres URL nie jest adresem URL HTTP.

Implementuje

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Parse metody . Ten przykład kodu jest częścią większego przykładu podanego HttpClientChannel dla klasy.

// Parse the channel's URI.
String^ objectUrl = L"http://localhost:9090/RemoteObject.rem";
String^ channelUri = clientChannel->Parse( objectUrl,  objectUri );
Console::WriteLine( L"The object URL is {0}.", objectUrl );
Console::WriteLine( L"The object URI is {0}.", objectUri );
Console::WriteLine( L"The channel URI is {0}.", channelUri );
// Parse the channel's URI.
string objectUrl = "http://localhost:9090/RemoteObject.rem";
string channelUri = clientChannel.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);

Dotyczy

Zobacz też