zoukankan      html  css  js  c++  java
  • 天气预报WebService的使用。

            /// <summary>
            /// 获取天气数据调用WebServer(地址:http://www.ayandy.com 命名空间:www.ayandy.com
            /// </summary>
            /// <param name="cityName">城市名称</param>
            /// <param name="day">日期(1:今天 2:明天 3:后天)</param>
            /// <returns>返回信息数组(1:城市 2:天气 3:温度 4:风向 5:日期 6:图标)</returns>
            public String[] getWeather(String cityName, int day)
            {
                com.ayandy.www.Service mWeatherWebService = new com.ayandy.www.Service();//构造服务
                String[] WeatherOfCity = new string[6];
                switch (day)
                {
                    case 1:

                        WeatherOfCity = mWeatherWebService.getWeatherbyCityName(cityName, com.ayandy.www.theDayFlagEnum.Today);//获取今天天气信息
                        break;
                    case 2:
                        WeatherOfCity = mWeatherWebService.getWeatherbyCityName(cityName, com.ayandy.www.theDayFlagEnum.Tomorrow);//获取明天天气信息
                        break;
                    case 3:
                        WeatherOfCity = mWeatherWebService.getWeatherbyCityName(cityName, com.ayandy.www.theDayFlagEnum.theDayafterTomorrow);//获取后天天气信息
                        break;
                }
                return WeatherOfCity;
            }

  • 相关阅读:
    eclipse修改web项目部署路径
    Jquery面试题
    23中设计模式之单例模式
    详细探讨单例模式
    java常用设计模式
    vue官网总结
    pytorch模型训练加速tricks
    element table显示滚动条
    vue中less文件全局引用
    vue路径别名无法识别,Cannot find module
  • 原文地址:https://www.cnblogs.com/mane/p/1984830.html
Copyright © 2011-2022 走看看