public class CWeather
{
public static string GetAllWetherInfo()
{
string info = "";
info += GetCityWetherIfo("天津") + " " + GetCityWetherIfo("唐山") + " " + GetCityWetherIfo("承德");
return info;
}
public static string GetCityWetherIfo(string cityName)
{
string strWether;
string CenterName;
string url;
//城市的中文名称
string CityCName;
string rootName;
if (cityName == "天津" || cityName == "天津市" || cityName == "tianjin")
{
url = "http://flash.weather.com.cn/wmaps/xml/" + "tianjin.xml";
CenterName = "市中心";
CityCName = "天津";
rootName = "tianjin";
}
else if (cityName == "承德" || cityName == "承德市" || cityName == "chengde")
{
url = "http://flash.weather.com.cn/
获取天气预报接口
最新推荐文章于 2024-07-23 15:44:54 发布