how to make 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"
}