{"lstCitiesResult":[{"city_id":"21","city_name":"Trichy"},
{"city_id":"22","city_name":"Chennai"},
{"city_id":"24","city_name":"Mumbai"},
{"city_id":"25","city_name":"Hyderabad"}] }
问问题
180 次
1 回答
1
您可以使用json.net反序列化您的 json 字符串。定义你自己的类:
public class City
{
public int City_id { get; set; }
public string City_name { get; set; }
}
public class YourModel
{
public City[] lstCitiesResult { get; set; }
}
所以你可以打电话:
var model = JsonConvert.DeserializeObject<YourModel>(jsonString);
于 2012-11-02T11:11:39.743 回答