how to create json file code example
Example 1: how to create json file in c#
//open file stream
using (StreamWriter file = File.CreateText(@"D:\path.txt"))
{
JsonSerializer serializer = new JsonSerializer();
//serialize object directly into file stream
serializer.Serialize(file, _data);
}
Example 2: how to set up a json file
{
"name" : "data"
}
Example 3: html working with JSON data
superHeroes['members'][1]['powers'][2]