天气预报控件

in Develop

数据源取自:http://weather.msn.com/

原本是打算直接获取页面源代码,然后分析出需要的结果。
但这有二个弊端:
1、如果页面结构改了,我就得重写代码;
2、图片地址要转成绝对路径。
不小心让我发现msnweather提供了每个城市的天气预报rss
遂直接取rss内容即可。
直接将控件放到工具箱, 拖放到.aspx页面上,设置RSS地址即可
rss地址可以到这里来获取:
http://weather.msn.com/region.aspx?wealocations=China
可以有多个控件,设置不同的rss地址即可显示多个不同城市的天气预报。
理论上天气预报会缓存10分钟
效果:

文件下载:
WeatherLib.dll (12.00 kb)

2 Comments

2 Comments

  1. 不知道怎么用,php的有吗?

  2. 这个是.net的控件
    php也可以写啊

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>