C# read JSON file or data, update and save it

 
string jsonText = File.ReadAllText("data.json");
dynamic obj = JsonConvert.DeserializeObject(jsonText);
obj["success"] = false;

string objText = JsonConvert.SerializeObject(obj, Formatting.Indented);
Console.WriteLine(objText);

File.WriteAllText("data.json", objText);
创建时间:2/23/2023 4:45:07 PM 修改时间:2/23/2023 4:46:34 PM