I want to get a web page (it is a server), on which there's information in json format.
I get the said page and if I check variable called json, I see that it contains correct json text.
The question is: how do I parse this JSON information?
Details: I have a WPF app, where I want to have some info from JSON in a Text Block when I press a button - but not everything but, for example, only one field. Also, I can't copy the code in file in advance because webpage is being updated and I need to load it every other time. This code gets the page and JSON code:
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
using (var webClient = new System.Net.WebClient())
{
var json = webClient.DownloadString((My_Url));
Newtonsoft.Json.Linq.JObject o = Newtonsoft.Json.Linq.JObject.Parse(json);
json = Encoding.UTF8.GetString(webClient.DownloadData(My_Url));
List1.Text = json.ToString();
}
}
This is sample json code:
{ "response": { "status": {"ok", "data": { "30" : {"title":{ "London", "Country": "Britain"}, "24": {"title":"Paris", "Country": "France"} }}
So I'd like to see in my listbox a list of "London, Paris"