I have a JSON file containing some 15,000 keys. I'm writing an app which will edit the values of 8 keys without replacing anything else. So far I've managed to replace the entire file when editing an integer:
// currentDir = app directory
Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText(currentDir + "character.json")
Dim json As String = fileReader
Dim read = Newtonsoft.Json.Linq.JObject.Parse(json)
read.Item("Info")("Experience") = Convert.ToInt32(boxNewExp.Text)
Dim output As String = JsonConvert.SerializeObject(json, Newtonsoft.Json.Formatting.Indented)
IO.File.WriteAllText(currentDir + "character.json", output)
The answer in this question by agentnega is something that I tried to implement to no avail. I imagine I could use this method a bit better, but I haven't worked with VB for a while.