コード例 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            String s = this.selfcity.Text;//用户输入的城市名

            WeatherWeb.WeatherWebService ws = new WeatherWeb.WeatherWebService();
            showwea.Clear();
            String[] nums = ws.getWeatherbyCityName(s);
            showwea.AppendText(nums[0] + nums[1] + "\n");
            for (int i = 4; i < 20; i++)
            {
                showwea.AppendText(nums[i] + "\n");
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            WeatherWeb.WeatherWebService ws = new WeatherWeb.WeatherWebService();
            //WeatherWeb为前面天气引用的名字
            showwea.Clear();
            String city = this.city2.Text;

            String[] nums = ws.getWeatherbyCityName(city);
            showwea.AppendText(nums[0] + nums[1] + "\n");
            for (int i = 4; i < 20; i++)
            {
                showwea.AppendText(nums[i] + "\n");
            }
        }