語言

ServiceHealthBehavior.TryParseBooleanQueryParameter 方法

定義

嘗試解析布林查詢字串參數,並回傳一個值,表示解析操作是否成功。

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

參數

parameterName
String

方法是方法嘗試解析的參數名稱。

parameter
String

查詢字串的欄位/值對。

defaultValue
Boolean

如果解析操作失敗,該參數應被指派給 result 該參數。

result
Boolean

當方法回傳時,解析後的布林參數值。

傳回

true若解析操作成功;否則,。 false

例外狀況

parameterName 是 null。

-或-

parameter 是 null。

備註

若方法成功解析該欄位的值,該方法會true回傳Boolean.TryParse。

適用於