I'm trying to get my JSON data with a console app using visual studio 2012 and c#. This is my code :
using System.Linq;
using System.Text;
using System.Net;
using System.Web.Services;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Web.Script.Serialization;
using System.Web.Helpers;
using System.IO;
using System.Runtime.Serialization.Json;
namespace JSONTest
{
class Program
{
static void Main(string[] args)
{
//create a new instance of Webclient and use DownloadString method from the Webclient class to extract download html
WebClient client = new WebClient();
string Json1 = client.DownloadString("http://waelhamda.host22.com/localRobot.php");
JObject objParserd = JObject.Parse(Json1);
Console.WriteLine(Json1);
Console.ReadLine();
}
}
}
I got this error message while testing the app :
Additional text encountered after finished reading JSON content: <. Path '', line 3, position 0.
and it's in this line of code : JObject objParserd = JObject.Parse(Json1);