WebServices(http://www.webxml.com.cn/WebServices/WeatherWebService.asmx)来实现天气预报,该天气预报 Web 服务,数据来源于中国气象局 http://www.cma.gov.cn/ ,数据每2.5小时左右自动更新一次,准确可靠。包括 340 多个中国主要城市和 60 多个国外主要城市三日内的天气预报数据。

private void buttonWeather_Click_1(object sender, EventArgs e)
{
Weather.WeatherWebServiceSoapClient w = new Weather.WeatherWebServiceSoapClient("WeatherWebServiceSoap");
//把webservice当做一个类来操作
string[] s = new string[];//声明string数组存放返回结果
string city = this.textBox1.Text.Trim();//获得文本框录入的查询城市
s = w.getWeatherbyCityName(city);
//以文本框内容为变量实现方法getWeatherbyCityName
if (s[] == "")
{
MessageBox.Show("暂时不支持您查询的城市");
}
else
{
pictureBox1.Image = Image.FromFile(@"d:\image\" + s[] + "");
this.label4.Text =s[]+" "+s[];
textBox2.Text = s[];
} }

最新文章

  1. exportfs 入门/ 错误
  2. spring3 DI基础
  3. Groovy 转换JSON和生产JSON
  4. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Final
  5. c++ map 的基本操作
  6. C library function - freopen()
  7. 学习jsp(1)
  8. python基础(set)补充
  9. Linux段管理,BSS段,data段,.rodata段,text段
  10. sphinx cmd command
  11. (转)WebSphere MQ基础命令
  12. oracle to_date 函数
  13. 【alpha阶段】第八次Scrum Meeting
  14. Flex布局【弹性布局】学习
  15. HTTPS IP直连问题小结
  16. 20165321 学习基础与C语言学习心得
  17. Mycat入门配置_读写分离配置
  18. POJ1807&&1276
  19. Mac环境下WingIDE切换python版本
  20. BZOJ3243 NOI2013向量内积(随机化)

热门文章

  1. 9 I/O复用
  2. ActionScript基本语法讲解
  3. sublime text3使用心得及个人配置 sublime常用快捷键大全
  4. Request/Server的相关topic
  5. POJ 1548 Robots (Dilworth)
  6. POJ 2153 Rank List (map映射)
  7. 关于iOS7 上下黑条解决办法
  8. Codeforces Round #260 (Div. 2) A~C
  9. HBase保存的各个字段意义解释
  10. BestCoder 1st Anniversary($) 1003 Sequence