Share via


ServiceHealthBehavior.TryParseHttpStatusCodeQueryParameter 方法

定義

嘗試剖析查詢字串變數的 HTTP 狀態碼,並傳回值,指出剖析作業是否成功。

protected:
 static bool TryParseHttpStatusCodeQueryParameter(System::String ^ parameterName, System::String ^ parameter, System::Net::HttpStatusCode defaultErrorCode, [Runtime::InteropServices::Out] System::Net::HttpStatusCode % result);
protected static bool TryParseHttpStatusCodeQueryParameter (string parameterName, string parameter, System.Net.HttpStatusCode defaultErrorCode, out System.Net.HttpStatusCode result);
static member TryParseHttpStatusCodeQueryParameter : string * string * System.Net.HttpStatusCode * HttpStatusCode -> bool
Protected Shared Function TryParseHttpStatusCodeQueryParameter (parameterName As String, parameter As String, defaultErrorCode As HttpStatusCode, ByRef result As HttpStatusCode) As Boolean

參數

parameterName
String

方法嘗試剖析其值的參數名稱。

parameter
String

查詢字串的欄位/值組。

defaultErrorCode
HttpStatusCode

如果剖析作業失敗,要指派給引數的值。

result
HttpStatusCode

當方法傳回時,這是已剖析 HTTP 狀態碼引數的值。

傳回

Boolean

若剖析作業成功即為 true;否則為 false

例外狀況

parameterNamenull

-或-

parameternull

適用於