我是 Json 序列化和反序列化的新手,
我有
class TestClass
{
public string Name{get;set;}
public string Age{get;set;}
public string Height{get;set;}
}
并具有以下序列化功能
public void SerializeData()
{
string jsonData = "{
{"Name" : "Zeus","Age" : "1825","Height" : "900"},
{"Name" : "Hera","Age" : "1805","Height" : "200"}
}";
var resultList = new List<TestClass>();
var ser = new JavaScriptSerializer();
resultList= serializer.Deserialize(jsonData , TestClass)
}
但它不起作用!不断抛出“参数异常”
请问有什么帮助吗?