Skip to main content

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

NuGet: https://www.nuget.org/packages/newtonsoft.json/

After adding the reference to your project, you just include the following usingusing at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_valuelicense_value = json["licencse"]json["license"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

NuGet: https://www.nuget.org/packages/newtonsoft.json/

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

NuGet: https://www.nuget.org/packages/newtonsoft.json/

After adding the reference to your project, you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string license_value = json["license"].ToObject<string>();
added 58 characters in body
Source Link
JoshVarty
  • 9.5k
  • 4
  • 56
  • 84

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

NuGet: https://www.nuget.org/packages/newtonsoft.json/

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

NuGet: https://www.nuget.org/packages/newtonsoft.json/

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();
Fixed incorrect variable name
Source Link
JoshVarty
  • 9.5k
  • 4
  • 56
  • 84

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var req =request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var req = (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();

I'd strongly recommend looking into Newtonsoft.Json:

http://james.newtonking.com/pages/json-net.aspx

After adding the reference to your project you just include the following using at the top of your file:

using Newtonsoft.Json.Linq;

And then within your method you can use:

var request= (HttpWebRequest)WebRequest.Create("www.example.com/ex.json");
var response = (HttpWebResponse)request.GetResponse();
var rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();

var json = JObject.Parse(rawJson);  //Turns your raw string into a key value lookup
string licsene_value = json["licencse"].ToObject<string>();
added 47 characters in body
Source Link
JoshVarty
  • 9.5k
  • 4
  • 56
  • 84
Loading
Source Link
JoshVarty
  • 9.5k
  • 4
  • 56
  • 84
Loading