c# json
需要添加 newtonsoft.json dll Per p1 = new Per(); p1.names = "zwj"; p1.zwj = "九阳神功"; //序列化 this.Text = JsonConvert.SerializeObject(p1); // 反序列化 Per p = (Per)JsonConvert.DeserializeObject(this.Text, typeof(Per)); MessageBox.Show(p.zwj); class Per { public string names { get; set; } public string zwj { get; set; } }