查询天气的服务引用,有类似的吧;

首先要引用这个服务,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]+" "+s[4]+s[5]+s[7]+s[8]+s[9]);
}
}

 w.getWeatherbyCityName(city);    返回的是一个以为数组,有兴趣的话可以看看里面都是什么内容;

原文地址:https://www.cnblogs.com/lao-K/p/11209570.html