I have a script for saving to file sorted, however I cant code it to save to entry: as below
{
"entry": [
{ "Name": "John" },
{ "Name": "Anna" },
{ "Name": "Peter" }
]
}
Im using json.Net, code below needs to add to entry: name
string json = JsonConvert.SerializeObject(results, Formatting.Indented);
string path = @"C:\inetpub\wwwroot\JSON\json.Net\results.json";
if (!File.Exists(path))
{
File.WriteAllText(path, json);
}
else
{
File.AppendAllText(path, json);
}
I haven't been able to find any good json code samples, cheers Paul
FileStream, write an extension method, create a wrapper class.