private async void buttonGo_Click(object sender, EventArgs e) { string apiKey = textBoxApiKey.Text; if (String.IsNullOrEmpty(apiKey)) return; SteamWebApiProxy proxy = new SteamWebApiProxy(BaseURL, apiKey); var servers = await proxy.GetServersAsync(10); foreach (var server in servers) { listBoxServers.Items.Add(server); } }
static async Task Main(string[] args) { SteamWebApiProxy proxy = new SteamWebApiProxy(BaseURL, "YOURSTEAMKEYHERE"); int limit = 10; if (args.Length > 0) { Int32.TryParse(args[0], out limit); } var servers = await proxy.GetServersAsync(limit); servers.ForEach(s => Console.WriteLine(s)); Console.ReadLine(); }
static async Task Main(string[] args) { Console.WriteLine("Steam CLI {0}\n{1}\n", Assembly.GetEntryAssembly().ImageRuntimeVersion, RuntimeInformation.OSDescription); SteamWebApiProxy proxy = new SteamWebApiProxy(BaseURL, "YOURSTEAMKEYHERE"); int limit = 10; if (args.Length > 0) { Int32.TryParse(args[0], out limit); } var servers = await proxy.GetServersAsync(limit); servers.ForEach(s => Console.WriteLine(s)); }