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 值。

例外狀況

propertyNamenull

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

index 小於 0 或大於 Count

適用於