ServiceHealthBehavior.TryParseBooleanQueryParameter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試解析布林查詢字串參數,並回傳一個值,表示解析操作是否成功。
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
例外狀況
備註
若方法成功解析該欄位的值,該方法會true回傳Boolean.TryParse。