語言

JsonElement.TryGetInt64(Int64) 方法

定義

嘗試將目前的 JSON 數字表示為 Int64.

public:
 bool TryGetInt64([Runtime::InteropServices::Out] long % value);
public bool TryGetInt64(out long value);
member this.TryGetInt64 : int64 -> bool
Public Function TryGetInt64 (ByRef value As Long) As Boolean

參數

value
Int64

當此方法回傳時,包含 64 位元整數值,若轉換成功則等同於當前 JSON 數值,若轉換失敗則為 0。

傳回

true若該數字可表示為Int64;否則,。 false

例外狀況

這個值的 ValueKind 值不是 Number。

父母 JsonDocument 已被處理掉。

備註

此方法不會解析 JSON 字串值的內容。

適用於