title: Get value from json data using c#
body: <p>I am creating a project of Windows Forms Application using C#</p>
  
  <p>I want to show all information(like CityName,CountryCode, etc in different Label) related to IP Address that is on my TextBox.
  I already read many article about <code>JsonConvert</code> and I don't want to use <code>JsonConvert</code>.</p>
  
  <p>here is my c# code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.IO;
  using System.Linq;
  using System.Net;
  using System.Text;
  using System.Threading.Tasks;
  using System.Web.Script.Serialization;
  using System.Windows.Forms;
  
  namespace GetIPinfo
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              List&lt;LocaionInfo1&gt; locations = new List&lt;LocaionInfo1&gt;();
              string url = string.Format("http://ipinfo.io/" + txtip.Text);
              using (WebClient client = new WebClient())
              {
                  string json = client.DownloadString(url);
                  LocaionInfo1 location = new JavaScriptSerializer().Deserialize&lt;LocaionInfo1&gt;(json);
                  locations.Add(location);
              }
  
              if (locations.Count &gt; 0)
              {
                  foreach (LocaionInfo1 loc in locations)
                  {
                      label9.Text = loc.CityName;
                      label10.Text = loc.CountryCode;
                      label11.Text = loc.CountryName;
                  }
              }
          }
  
          public class LocaionInfo1
          {
              public string IPAddress { get; set; }
              public string CountryName { get; set; }
              public string CountryCode { get; set; }
              public string CityName { get; set; }
              public string RegionName { get; set; }
              public string ZipCode { get; set; }
              public string Latitude { get; set; }
              public string Longitude { get; set; }
              public string TimeZone { get; set; }
          }
      }
  }
  </code></pre>
  
  <p>The problem is that when i Debug this code and Enter IP in my TextBox and then click on Submit Button
  My <code>LocaionInfo1 location = new JavaScriptSerializer().Deserialize&lt;LocaionInfo1&gt;(json);</code>
  is <code>NULL</code> values.</p>
  
  <p>JSON Data is:</p>
  
  <pre><code>{
    "ip": "182.69.151.41",
    "hostname": "abts-north-dynamic-041.151.69.182.airtelbroadband.in",
    "city": null,
    "country": "IN",
    "loc": "20.0000,77.0000",
    "org": "AS24560 Bharti Airtel Ltd., Telemedia Services"
  }
  </code></pre>
  
  <p>So please help to get these all values.
  I am using Visual Studio 2012.</p>