1、Player类:
2、将一个对象转化为json字符串:
class Program
{
static void Main(string[] args)
{
player p = new player();
p.Name = “ZX”;
p.Level = 100;
p.Age = 18;
string str = JsonMapper.ToJson§;
Console.WriteLine(str);
Console.ReadKey();
}
}
运行结果:
1、Player类:
2、将一个对象转化为json字符串:
class Program
{
static void Main(string[] args)
{
player p = new player();
p.Name = “ZX”;
p.Level = 100;
p.Age = 18;
string str = JsonMapper.ToJson§;
Console.WriteLine(str);
Console.ReadKey();
}
}
运行结果: