Traditional Culture Encyclopedia - Weather forecast - Weather forecast network service

Weather forecast network service

First, under your web project, you can right-click References and then click Add Web.

Refercenes then enter the address of /WebServices/WeatherWS.asmx after the URl text box, click the green arrow behind it, and then click the Add button. At this point, a namespace will appear under WebReferrecens in the web project, which is a class contained in the web service, and then you add a test button to the page. Write the following code in the button event: cn.com.webxml.webservice.weatherwws = newcn.com.webxml.webservice.weatherws ();

string[]data = wws . getweather(" Shanghai "," ");

The data array is the data about the weather in Shanghai, and then you can do it according to the actual situation.