A reliable weather forecast Web Server

Source: Internet
Author: User

A reliable weather forecast Web Server:

Http://www.ayandy.com/

Getweatherbycityname
Obtain weather conditions based on the city name. This service data comes from the data of the China Meteorological Administration, which is updated in real time and accurate and reliable. The call method is as follows: Enter the parameter thecityname (Chinese name of the city, for example, Shenzhen or Beijing; thedayflag indicates the current day (1), Tomorrow (2), or the next day (3 ), you can query the weather conditions in the next three days. The returned data is a one-dimensional value in string [7]. There are seven elements, from [1] to [6], indicating the city, weather, and temperature respectively, wind direction, date, and weather icon address. Author QQ: 15244833 welcome to communicate with friends :)

Supports data from cities and the China Meteorological Administration.

 

 

C #Code:
Using system;
Using system. Collections. Generic;
Using system. componentmodel;
Using system. Data;
Using system. drawing;
Using system. text;
Using system. Windows. forms;

namespace windowsapplication1
{< br> Public partial class form1: Form
{< br> Public form1 ()
{< br> initializecomponent ();
}

private void form1_load (Object sender, eventargs e)
{< br> string [] Cs;
cs = new COM. ayandy. www. service (). getsupportprovince ();
int16 length;
length = convert. toint16 (CS [0]);

For (INT I = 1; I <= length; I ++)
This. combobox1.items. Add (CS [I]);

}

Private void button#click (Object sender, eventargs E)
{
String [] result = new COM. ayandy. www. Service (). getweatherbycityname (this. combobox2.text, Com. ayandy. www. thedayflagenum. Today );

MessageBox. Show (result [1] + "/" + result [2] + "/" + result [3]);

}

Private void combobox#selectedindexchanged (Object sender, eventargs E)
{
String [] city;

Int16 length;

City = new COM. ayandy. www. Service (). getsupportcity (this. combobox1.text );
Length = convert. toint16 (City [0]);

For (INT I = 1; I <= length; I ++)
This. combobox2.items. Add (City [I]);

}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.