Answers for "change value of json in object c#"

C#
1

c# update value in a json file

string json = File.ReadAllText("settings.json");
dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);
jsonObj["Bots"][0]["Password"] = "new password";
string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText("settings.json", output);
Posted by: Guest on December-06-2021
0

c# convert object to json

var jsonString = JsonConvert.SerializeObject(ObjectModel);
Posted by: Guest on December-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language