2
S'il vous plaît aidez-moi, comment faire JSON dans Windows Phone Parsing 7 en utilisant l'URL donnée est https://data.cityofchicago.org/api/views/xzkq-xp2w/rows.json?search=rahmJSON dans Parsing Windows Phone
S'il vous plaît aidez-moi, comment faire JSON dans Windows Phone Parsing 7 en utilisant l'URL donnée est https://data.cityofchicago.org/api/views/xzkq-xp2w/rows.json?search=rahmJSON dans Parsing Windows Phone
ajouter bibliothèque newtonnsoft JSON au studio visuel et utiliser ce code
WebClient webClient = new WebClient();
webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(downloadAboutCompleted);
webClient.OpenReadAsync(new Uri("https://data.cityofchicago.org/api/views/xzkq-xp2w/rows.json?search=rahm"), c);
private void downloadAlbumCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error == null && !e.Cancelled)
{
using (StreamReader httpwebStreamReader = new StreamReader(e.Result))
{
var results = httpwebStreamReader.ReadToEnd();
System.Diagnostics.Debug.WriteLine(results):
var json = JObject.Parse(results);
System.Diagnostics.Debug.WriteLine(json):
foreach (JObject array in json["meta"]["view"])
{
JObject obj = JObject.Parse(array.ToString());
string id= (string)obj["id"];
string name= (string)obj["name"];
System.Diagnostics.Debug.WriteLine(id + name):
}
}
}
}