我正在为 windows phone 8 工作。
我需要从 url 检索 Json 数据,我需要在数组中显示。
我的 url 有这样的 jsondata。
{ id: 9
address: "abc"
city: " chennai"
contact1: ""
contact2: ""
country: " india"
description: ""
}
我想知道如何检索这些数据并将其存储在数组中?
这是我用来检索 Json 数据的语句。
private string REST_URL = "my url"; //i'm using my url here to extract the json data..
String servicePath = REST_URL + "/data/" + query;
Detail[] detail = JsonConvert.DeserializeObject<Detail[]>(servicePath);
return detail;
我完整的 Json 数据
[
{
"id": 01,
"address": "12asdf",
"city": " chennai",
"contact1": "",
"contact2": "",
"country": " india",
"description": "",
"name": " david",
"region": "",
"state": " 033",
"website": "",
"image": "",
"PrayerTime": {
"id": 01,
"PrayerTime1": "00:52",
"PrayerTime2": "21:04",
"PrayerTime3": "12:27",
"PrayerTime4": "05:35",
"PrayerTime5": "21:04",
"created_at": null,
"PrayerTime6": "04:01",
"updated_at": null,
"organization_id": 001
}
},.............
}