接口地址http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
调用步骤:项目添加服务引用-高级-添加web引用 简单代码:
web服务名.WeatherWebService w = new web服务名.WeatherWebService();
//把webservice当做一个类来操作
string[] s = new string[23];//声明string数组存放返回结果
string city = this.textBox1.Text.Trim();//获得文本框录入的查询城市
s = w.getWeatherbyCityName(city);
//以文本框内容为变量实现方法getWeatherbyCityName
if (s[8] == "")
{
MessageBox.Show("暂时不支持您查询的城市");
}
else
{
this.GaiKuang.Text = s[1] + " " + s[6];
richTextBox1.Text = s[10];
}

  

最新文章

  1. Spring容器深入(li)
  2. jquery checkbox选中、改变状态、change和click事件
  3. Storm wordcount Read from file
  4. Python中dict的特点、更新dict、遍历dict
  5. jetty-run运行报错的原因
  6. FlashBuilder精选插件
  7. cmd 控制台 提示:请求的操作须要提升!
  8. STL set multiset map multimap unordered_set unordered_map example
  9. SSM拦截器应用
  10. HDU_1016——素环问题DFS
  11. perl 跨行匹配;
  12. ocp认证考试指南第一章
  13. 【Android】九宫格实现
  14. Composer - windows下安装方法
  15. Web自动化框架LazyUI使用手册(3)--单个xpath抓取插件详解(selenium元素抓取,有此插件,便再无所求!)
  16. linux下64位汇编的系统调用(4)
  17. 我的自定义框架 || 基于Spring Boot || 第一步
  18. 3_主流部署方式介绍-Django+gunicorn+nginx
  19. 纯小白入手 vue3.0 CLI - 2.7 - 组件之间的数据流
  20. 如何在Drupal7中用代码批量创建节点、评论和分类

热门文章

  1. python kafka权限校验client.id
  2. json转化技巧
  3. 视频播放—— H5同层播放器接入规范
  4. 心得体会,搞清楚你为什么学习C++?
  5. input type='file' 上传文件 判断图片的大小是否合格与witdh 和 height 是否合格
  6. 使用POST下载文件
  7. Github把自己的本地项目托管到git上
  8. 【数据结构】红黑树与跳表-(SortSet)-(TreeMap)-(TreeSet)
  9. python绘制图
  10. IntelliJ Idea 2017 免费激活方法