软卧代二等座,黄鹤楼烟多少钱一包,缱绻乱红情若伦
首先要引用这个服务,http://www.webxml.com.cn/webservices/weatherwebservice.asmx
添加服务和引用---->转到---->高级---->添加web应用---->添加引用 到此ok。 1个text,1个button,2个lable
private void btn_search_click(object sender, eventargs e)
{
cn.com.webxml.www.weatherwebservice w = new cn.com.webxml.www.weatherwebservice();
string[] s = new string[23];
string city = text_city.text.trim();
s = w.getweatherbycityname(city);
if(s[8]=="")
{
messagebox.show("暂不支持查询的城市");
}
else
{
label_gaikuang.text = s[1] + "" + s[6];
label_shikuang.text = s[10];
messagebox.show(s[3]+"\n\r"+s[4]+s[5]+s[7]+s[8]+s[9]);
}
}
w.getweatherbycityname(city); 返回的是一个以为数组,有兴趣的话可以看看里面都是什么内容;
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论