I am using C# to parse JSON URL. As you know JSON data is written as name/value pairs. Now in URL JSON I have these data:
{
"currentVersion":10.41,
"serviceDescription":"There are some text here",
"hasVersionedData":true,
"supportsDisconnectedEditing":false,
"syncEnabled":false,
"supportedQueryFormats":"JSON",
"maxRecordCount":1000
}
and I want to only print out the name part of the JSON data using this code:
using (var wc = new WebClient())
{
string json = wc.DownloadString("http://xxxxxxxxx?f=pjson");
try
{
dynamic data = Json.Decode(json);
for (int i = 0; i <= data.Length - 1; i++)
{
Console.WriteLine(data[0]);
}
}
catch (Exception e)
{
}
}
but this is not printing anything on the console. What am I doing wrong?