JsonElement.GetArrayLength 方法

定义

获取当前数组值中包含的值的数量。Gets the number of values contained within the current array value.

public:
 int GetArrayLength();
public int GetArrayLength ();
member this.GetArrayLength : unit -> int
Public Function GetArrayLength () As Integer

返回

Int32

当前数组值中包含的值的数量。The number of values contained within the current array value.

例外

此值的 ValueKind 不是 ArrayThis value's ValueKind is not Array.

已释放父级 JsonDocumentThe parent JsonDocument has been disposed.

注解

有关详细信息,请参阅 如何在上编写自定义序列化程序和反 System.Text.JsFor more information, see How to write custom serializers and deserializers with System.Text.Json.

适用于