📜  c# 将 json 写入文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:52.648000             🧑  作者: Mango

代码示例2
//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);
}