string jsonArray = "{\"status\":0,\"result\":[{\"x\":120.61156868924,\"y\":31.283360501782}]}";
JavaScriptSerializer json = new JavaScriptSerializer();
Coordinate re = json.Deserialize(jsonArray, typeof(Coordinate)) as Coordinate;
string x = re.result[0].x;
[Serializable]
class Coordinate
{
private List<result> _result;
public int status { get; set; }
public List<result> result
{
set { _result = value; }
get { return _result; }
}
}
[Serializable]
class result
{
public string x { get; set; }
public string y { get; set; }
}
C# .NET 后台 json 转 类库 获取数据
最新推荐文章于 2024-08-23 10:35:13 发布