Advertisement

处理JSON文件

阅读量:

一、JSON中使用C#File.WriteAllText与JObject.WriteTo方法写文件

  1. 生成json文件存在两种方式,其一是借助C#语言中的File.WriteAllText()方法,其二是采用JObject.WriteTo()函数实现。
复制代码
 using System;

    
 using System.Collections.Generic;
    
 using System.Linq;
    
 using System.Text;
    
 using System.Data;
    
 using System.Web;
    
 using GongHuiNewtonsoft.Json;
    
 using GongHuiNewtonsoft.Json.Linq;
    
  
    
 namespace JSONDemo
    
 {
    
     class Program
    
     {
    
     static void Main(string[] args)
    
     {
    
         JObject o = new JObject(
    
             new JProperty("Name","《华胥引》"),
    

全部评论 (0)

还没有任何评论哟~