示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Querry = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 516922 and u='c' &format=json";
            QuerryKrosno = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 502438 and u='c' &format=json";
            QuerryJaslo = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 497151 and u='c' &format=json";
            QuerryPrzemysl = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 514387 and u='c' &format=json";
            QuerrySanok = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 517369 and u='c' &format=json";
            QuerrySacz = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 509923 and u='c' &format=json";
            QuerrySvidnik = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 509923 and u='c' &format=json";
            QuerryDukla = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 492348 and u='c' &format=json";
            QuerryBrzozow = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 488211 and u='c' &format=json";
            QuerryStrzyzow = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 520664 and u='c' &format=json";
            QuerryRzeszow = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 517126 and u='c' &format=json";
            QuerryGorlice = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = 494420 and u='c' &format=json";

            var Generalforecast = info.GetWeather(Querry);
            var GeneralforecastKrosno = info.GetWeather(QuerryKrosno);
            var GeneralforecastJaslo = info.GetWeather(QuerryJaslo);
            var GeneralforecastPrzemysl = info.GetWeather(QuerryPrzemysl);
            var GeneralforecastSanok = info.GetWeather(QuerrySanok);
            var GeneralforecastSacz = info.GetWeather(QuerrySacz);
            var GeneralforecastSvidnik = info.GetWeather(QuerrySvidnik);
            var GeneralforecastDukla = info.GetWeather(QuerryDukla);
            var GeneralforecastBrzozow = info.GetWeather(QuerryBrzozow);
            var GeneralforecastStrzyzow = info.GetWeather(QuerryStrzyzow);
            var GeneralforecastRzeszow = info.GetWeather(QuerryRzeszow);
            var GeneralforecastGorlice = info.GetWeather(QuerryGorlice);

            var Windforecast = info.GetWeatherWind(Querry);
            var Atmosphereforecast = info.GetWeatherAtmosphere(Querry);
            var AstronomyTime = info.GetAstrononyTime(Querry);
            var Forecast = info.GetForecast(Querry);

            City.Text = "Rymanów";
            Local.Text = "Aktualna Prognoza";
            label1.Text = Generalforecast.text;
            label2.Text = Generalforecast.temp + " C";
            label3.Text = Windforecast.speed + " km/h";
            label4.Text = Atmosphereforecast.humidity + " %";
            label11.Text = AstronomyTime.sunrise;
            label12.Text = AstronomyTime.sunset;

            Day1.Text = Forecast[0].day;
            Day2.Text = Forecast[1].day;
            Day3.Text = Forecast[2].day;
            Day4.Text = Forecast[3].day;
            Day5.Text = Forecast[4].day;
             
            temp1.Text = Forecast[0].high + " C";
            temp2.Text = Forecast[1].high + " C";
            temp3.Text = Forecast[2].high + " C";
            temp4.Text = Forecast[3].high + " C";
            temp5.Text = Forecast[4].high + " C";

            con1.Text = Forecast[0].text;
            con2.Text = Forecast[1].text;
            con3.Text = Forecast[2].text;
            con4.Text = Forecast[3].text;
            con5.Text = Forecast[4].text;

            mapl_c.Text = Generalforecast.temp + " C";
            mapl1_c.Text = GeneralforecastKrosno.temp + " C";
            mapl2_c.Text = GeneralforecastJaslo.temp + " C";
            mapl3_c.Text = GeneralforecastPrzemysl.temp + " C";
            mapl4_c.Text = GeneralforecastSanok.temp + " C";
            mapl5_c.Text = GeneralforecastSacz.temp + " C";
            mapl6_c.Text = GeneralforecastSvidnik.temp + " C";
            mapl7_c.Text = GeneralforecastDukla.temp + " C";
            mapl8_c.Text = GeneralforecastBrzozow.temp + " C";
            mapl9_c.Text = GeneralforecastStrzyzow.temp + " C";
            mapl10_c.Text = GeneralforecastRzeszow.temp + " C";
            mapl11_c.Text = GeneralforecastGorlice.temp + " C";

            mapl.Text = Generalforecast.text;
            mapl1.Text = GeneralforecastKrosno.text;
            mapl2.Text = GeneralforecastJaslo.text;
            mapl3.Text = GeneralforecastPrzemysl.text;
            mapl4.Text = GeneralforecastSanok.text;
            mapl5.Text = GeneralforecastSacz.text;
            mapl6.Text = GeneralforecastSvidnik.text;
            mapl7.Text = GeneralforecastDukla.text;
            mapl8.Text = GeneralforecastBrzozow.text;
            mapl9.Text = GeneralforecastStrzyzow.text;
            mapl10.Text = GeneralforecastRzeszow.text;
            mapl11.Text = GeneralforecastGorlice.text;

            SetUp();
        }