JsonObject.Add 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Add(KeyValuePair<String,JsonValue>) |
將項目加入至 ICollection<T>。 |
Add(String, JsonValue) |
將隨附有索引鍵和值的項目加入至 IDictionary<TKey,TValue>。 |
Add(KeyValuePair<String,JsonValue>)
將項目加入至 ICollection<T>。
public:
virtual void Add(System::Collections::Generic::KeyValuePair<System::String ^, System::Json::JsonValue ^> pair);
public void Add (System.Collections.Generic.KeyValuePair<string,System.Json.JsonValue> pair);
abstract member Add : System.Collections.Generic.KeyValuePair<string, System.Json.JsonValue> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, System.Json.JsonValue> -> unit
Public Sub Add (pair As KeyValuePair(Of String, JsonValue))
參數
- pair
- KeyValuePair<String,JsonValue>
實作
備註
注意
命名空間 System.Json 是針對不再支援的 Silverlight 所設計。 若要處理 JSON,建議您改用 命名空間中的 System.Text.Json API。
適用於
Add(String, JsonValue)
將隨附有索引鍵和值的項目加入至 IDictionary<TKey,TValue>。
public:
virtual void Add(System::String ^ key, System::Json::JsonValue ^ value);
public void Add (string key, System.Json.JsonValue value);
abstract member Add : string * System.Json.JsonValue -> unit
override this.Add : string * System.Json.JsonValue -> unit
Public Sub Add (key As String, value As JsonValue)
參數
- key
- String
做為要加入項目之索引鍵的物件。
- value
- JsonValue
做為要加入項目之值的物件。
實作
備註
注意
命名空間 System.Json 是針對不再支援的 Silverlight 所設計。 若要處理 JSON,建議您改用 命名空間中的 System.Text.Json API。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應