语言

JsonObject.Insert(Int32, String, JsonNode) 方法

定义

将属性插入到指定索引处的对象中。

public:
 void Insert(int index, System::String ^ propertyName, System::Text::Json::Nodes::JsonNode ^ value);
public void Insert(int index, string propertyName, System.Text.Json.Nodes.JsonNode? value);
member this.Insert : int * string * System.Text.Json.Nodes.JsonNode -> unit
Public Sub Insert (index As Integer, propertyName As String, value As JsonNode)

参数

index
Int32

应插入属性的从零开始的索引。

propertyName
String

要插入的属性名称。

value
JsonNode

要插入的 JSON 值。

例外

propertyName 是 null。

中已存在具有相同键的 JsonObject元素。

index 小于 0 或大于 Count。

适用于