.Net 调用中国气象台Web Service
2024-10-18 23:28:52
接口地址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];
}
最新文章
- Spring容器深入(li)
- jquery checkbox选中、改变状态、change和click事件
- Storm wordcount Read from file
- Python中dict的特点、更新dict、遍历dict
- jetty-run运行报错的原因
- FlashBuilder精选插件
- cmd 控制台 提示:请求的操作须要提升!
- STL set multiset map multimap unordered_set unordered_map example
- SSM拦截器应用
- HDU_1016——素环问题DFS
- perl 跨行匹配;
- ocp认证考试指南第一章
- 【Android】九宫格实现
- Composer - windows下安装方法
- Web自动化框架LazyUI使用手册(3)--单个xpath抓取插件详解(selenium元素抓取,有此插件,便再无所求!)
- linux下64位汇编的系统调用(4)
- 我的自定义框架 || 基于Spring Boot || 第一步
- 3_主流部署方式介绍-Django+gunicorn+nginx
- 纯小白入手 vue3.0 CLI - 2.7 - 组件之间的数据流
- 如何在Drupal7中用代码批量创建节点、评论和分类
热门文章
- python kafka权限校验client.id
- json转化技巧
- 视频播放—— H5同层播放器接入规范
- 心得体会,搞清楚你为什么学习C++?
- input type='file' 上传文件 判断图片的大小是否合格与witdh 和 height 是否合格
- 使用POST下载文件
- Github把自己的本地项目托管到git上
- 【数据结构】红黑树与跳表-(SortSet)-(TreeMap)-(TreeSet)
- python绘制图
- IntelliJ Idea 2017 免费激活方法