日期:2014-05-17 浏览次数:20820 次
class Program
{
static void Main(string[] args)
{
string json = "{ type: \"Circle\", distance:\"1000\", data: [{ lat:\"43.52117\", lng:\"125.2456\"}] }";
Info info = JsonConvert.DeserializeObject<Info>(json);
Console.WriteLine(info.data[0].lng);//125.2456
}
}
public class Info
{
public string type { get; set; }
public int distance { get; set; }
public List<Data> data { get; set; }
}
public class Data
{
public double lat { get; set; }
public double lng { get; set; }
}