Пример #1
0
        private void getFantasyPredictionsJSON() //Straightforward fantasy lineup deserialization much like the tournament layout one
        {
            try
            {
                WebRequest fantasyLineupInfoGET = WebRequest.Create("https://api.steampowered.com/ICSGOTournaments_730/GetTournamentFantasyLineup/v1?key=" + Properties.Settings.Default.apiKey + Properties.Settings.Default.tournamentPickemPredictions);
                fantasyLineupInfoGET.ContentType = "application/json; charset=utf-8";
                Stream       fantasyLineupStream = fantasyLineupInfoGET.GetResponse().GetResponseStream();
                StreamReader fantasyLineupReader = new StreamReader(fantasyLineupStream);

                StringBuilder sb = new StringBuilder();

                while (fantasyLineupReader.EndOfStream != true)
                {
                    sb.Append(fantasyLineupReader.ReadLine());
                }

                fantasyLineupJSON = sb.ToString();

                deserializedFantasyLineup = JsonConvert.DeserializeObject <FantasyLineup_ResultWrapper>(fantasyLineupJSON);
            }
            catch (Exception exc)
            {
                MessageBox.Show("ERROR AARDVARK:\n\nThere was an issue retrieving fantasy lineup information: " + exc.ToString());
            }
        }
        //Straightforward fantasy lineup deserialization much like the tournament layout one
        private void getFantasyPredictionsJSON()
        {
            try
            {
                WebRequest fantasyLineupInfoGET = WebRequest.Create("https://api.steampowered.com/ICSGOTournaments_730/GetTournamentFantasyLineup/v1?key=" + Properties.Settings.Default.apiKey + Properties.Settings.Default.tournamentPickemPredictions);
                fantasyLineupInfoGET.ContentType = "application/json; charset=utf-8";
                Stream fantasyLineupStream = fantasyLineupInfoGET.GetResponse().GetResponseStream();
                StreamReader fantasyLineupReader = new StreamReader(fantasyLineupStream);

                StringBuilder sb = new StringBuilder();

                while (fantasyLineupReader.EndOfStream != true)
                {
                    sb.Append(fantasyLineupReader.ReadLine());
                }

                fantasyLineupJSON = sb.ToString();

                deserializedFantasyLineup = JsonConvert.DeserializeObject<FantasyLineup_ResultWrapper>(fantasyLineupJSON);
            }
            catch (Exception exc)
            {
                MessageBox.Show("ERROR AARDVARK:\n\nThere was an issue retrieving fantasy lineup information: " + exc.ToString());
            }
        }