Advertisement

JSON序列化与反序列化是处理数据的方法

阅读量:

一.把一个对象序列化JSON.

1.目标账户

复制代码
 using System;

    
 using System.Collections.Generic;
    
 using System.Linq;
    
 using System.Text;
    
  
    
 namespace JSONDemo
    
 {
    
     public class Account
    
     {
    
     public string Email { get; set; }
    
     public bool Active { get; set; }
    
     public DateTime CreateDate { get; set; }
    
     public IList<string> Roles { get; set; }
    
     }
    
 }
    
    
    
    
  1. 对Account对象进行序列化处理。
复制代码
 using System;

    
 using System.Collections.Generic;
    
 using System.Linq;
    
 using System.Text;
    
 us

全部评论 (0)

还没有任何评论哟~