Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Net;
- using Newtonsoft.Json;
- public class Test
- {
- public static void Main()
- {
- WebClient request = new WebClient();
- var url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=B88B7699C6EACAE138DDB93BED6467EC&steamids=76561198026602449";
- var response = request.DownloadString(url);
- var myObject = new RootObject();
- JsonConvert.PopulateObject(response, myObject);
- foreach (var player in myObject.response.players)
- {
- Console.WriteLine(player.personaname);
- }
- Console.ReadKey();
- }
- }
- public class Player
- {
- public string steamid { get; set; }
- public int communityvisibilitystate { get; set; }
- public int profilestate { get; set; }
- public string personaname { get; set; }
- public int lastlogoff { 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 class Response
- {
- public List<Player> players { get; set; }
- }
- public class RootObject
- {
- public Response response { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement