Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

c# write json to file

using System.Text.Json;
using System.Text.Json.Serialization;

List<data> _data = new List<data>();
_data.Add(new data()
{
    Id = 1,
    SSN = 2,
    Message = "A Message"
});

using FileStream fileStream = File.Create(@"D:path.json");
await JsonSerializer.SerializeAsync(createStream, _data);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #json #file
ADD COMMENT
Topic
Name
8+8 =