語言

HttpChannel.Parse(String, String) 方法

定義

從指定的 URL 中擷取通道 URI 及遠端知名物件 URI。

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

參數

url
String

從中提取遠端已知物件 URI 的 URL。

objectURI
String

當此方法回傳時,包含 String 一個儲存遠端已知物件 URI 的 。 這個參數會未初始化傳遞。

傳回

目前通道的 URI,或 null 是指定的 URL 是否為 HTTP URL。

實作

範例

下列程式代碼範例示範如何使用 Parse 方法。 此程式碼範例是本類別更大範例 HttpClientChannel 的一部分。

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

適用於

另請參閱