Using C# to parse JSON URL I am facing some issues. 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 any thing on the console! can you please let me know what I am doing wrong?