title: C# Deserialize json api response
body: <p>hey i want to Deserialize this json API response to get values including profile state etc for processing in the program. 
  i tried multiple ways from different questions in here but i get response as null.
  here is the code, correct me what i am doing wrong please</p>
  
  <pre><code>{
      "response": {
          "players": [{
              "steamid": "xxxxxxxxxxxxxxxxx",
              "communityvisibilitystate": 3,
              "profilestate": 1,
              "personaname": "xxxx xxxx",
              "lastlogoff": 1529478555,
              "commentpermission": 1,
              "profileurl": "xxxxxxxxxxxxxxx",
              "avatar": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
              "avatarmedium": "xxxxxxxxxxxxxxxxxxxxx",
              "avatarfull": "xxxxxxxxxxx",
              "personastate": 1,
              "realname": "xxxx",
              "primaryclanid": "xxxxxxxxxx",
              "timecreated": 1097464215,
              "personastateflags": 0
          }]
      }
  }
  </code></pre>
  
  <p>The code i tried</p>
  
  <pre><code>public class AccountInfo
      {
          public string steamid { get; set; }
          public int communityvisibilitystate { get; set; }
          public int profilestate { get; set; }
          public string personaname { get; set; }
          public ulong lastlogoff { get; set; }
          public int commentpermission { get; set; }
          public string profileurl { get; set; }
          public string avatar { get; set; }
          public string avatarmedium { get; set; }
          public string avatarfull { get; set; }
          public int personastate { get; set; }
          public string realname { get; set; }
          public string primaryclanid { get; set; }
          public ulong timecreated { get; set; }
          public int personastateflags { get; set; }
      }
  
      public class Response
      {
          public AccountInfo response { get; set; }
      }
  
      public class Response1
      {
          public Response players { get; set; }
      }
  
      static void Main(string[] args)
      {
          DeserilizeJson();
      }
  
      internal static void DeserilizeJson()
      {
          string json = GetUrlToString("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=xxxxxxxxxxxxxxxxxxxxx&amp;steamids=xxxxxxxxxxxxxxx");
          Console.WriteLine(json);
          Response1 info = JsonConvert.DeserializeObject&lt;Response1&gt;(json);
  
          using (StreamWriter file = File.CreateText(@"c:\test.json"))
          {
              JsonSerializer serializer = new JsonSerializer();
              serializer.Serialize(file, info);
          }
      }
  
      internal static string GetUrlToString(string url)
      {
          String Response = null;
  
          try
          {
              using (WebClient client = new WebClient())
              {
                  Response = client.DownloadString(url);
              }
          }
          catch (Exception)
          {                
              return null;
          }
  
          return Response;
      }
  </code></pre>