Share via


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

當方法傳回時,這是已剖析布林引數的值。

傳回

Boolean

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

例外狀況

parameterNamenull

-或-

parameternull

備註

如果方法已成功剖析欄位的值,則此方法會傳回 true Boolean.TryParse

適用於