C#—WebService

时间:2021-08-01 10:21:47

一、qq是否在线

1、添加Web引用    qqOnlineWebService

C#—WebService

        cn.com.webxml.www.qqOnlineWebService shelly1 = new NIIT1109.cn.com.webxml.www.qqOnlineWebService();//qq是否在线
private void button1_Click(object sender, EventArgs e)
{
Text = shelly1.qqCheckOnline("");
listBox1.Items.Add(Text);
}

二、查看城市天气   WeatherWebService

1、添加Web引用

cn.com.webxml.www1.WeatherWebService shelly = new NIIT1109.cn.com.webxml.www1.WeatherWebService();//天气
private void button2_Click(object sender, EventArgs e)
{
string[] weas = shelly.getWeatherbyCityName("苏州");
foreach (string wea in weas)
listBox1.Items.Add(wea);
}

C#—WebService