下面是雅虎天气返回的一个XML文件,
string Url = "http://xml.weather.yahoo.com/forecastrss?u=c&p=CHXX0016";
MSXML2.XMLHTTP _xmlhttp = new MSXML2.XMLHTTPClass();
_xmlhttp.open("GET", Url, true, null, null);
_xmlhttp.send("");
我相取得
<yweather:forecast day="Wed" date="26 Mar 2008" low="13" high="23" text="Partly Cloudy" code="30" />
<yweather:forecast day="Thu" date="27 Mar 2008" low="13" high="22" text="Showers" code="11" />
<yweather:forecast day="Fri" date="28 Mar 2008" low="12" high="19" text="Showers" code="11" />
<yweather:forecast day="Sat" date="29 Mar 2008" low="11" high="15" text="Showers" code="11" />
<yweather:forecast day="Sun" date="30 Mar 2008" low="11" high="17" text="Showers" code="11" />
这部分中的day,low,high,text,code的值,谁能帮忙写个正则或其它方法取得他们的值<item>
<title>Conditions for Chengdu, CH at 2:00 pm CST</title>
<geo:lat>30.67</geo:lat>
<geo:long>104.02</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Chengdu__CH/*http://weather.yahoo.com/forecast/CHXX0016_c.html</link>
<pubDate>Wed, 26 Mar 2008 2:00 pm CST</pubDate>
<yweather:condition text="Fair" code="34" temp="24" date="Wed, 26 Mar 2008 2:00 pm CST" />
<description><![CDATA[
<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/34.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 24 C<BR />
<BR /><b>Forecast:</b><BR />
Wed - Partly Cloudy. High: 23 Low: 13<br />
Thu - Showers. High: 22 Low: 13<br />
Fri - Showers. High: 19 Low: 12<br />
Sat - Showers. High: 15 Low: 11<br />
Sun - Showers. High: 17 Low: 11<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Chengdu__CH/*http://weather.yahoo.com/forecast/CHXX0016_c.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]></description>
<yweather:forecast day="Wed" date="26 Mar 2008" low="13" high="23" text="Partly Cloudy" code="30" />
<yweather:forecast day="Thu" date="27 Mar 2008" low="13" high="22" text="Showers" code="11" />
<yweather:forecast day="Fri" date="28 Mar 2008" low="12" high="19" text="Showers" code="11" />
<yweather:forecast day="Sat" date="29 Mar 2008" low="11" high="15" text="Showers" code="11" />
<yweather:forecast day="Sun" date="30 Mar 2008" low="11" high="17" text="Showers" code="11" />
<guid isPermaLink="false">CHXX0016_2008_03_26_14_00_CST</guid>
</item>
</channel>
string Url = "http://xml.weather.yahoo.com/forecastrss?u=c&p=CHXX0016";
MSXML2.XMLHTTP _xmlhttp = new MSXML2.XMLHTTPClass();
_xmlhttp.open("GET", Url, true, null, null);
_xmlhttp.send("");
我相取得
<yweather:forecast day="Wed" date="26 Mar 2008" low="13" high="23" text="Partly Cloudy" code="30" />
<yweather:forecast day="Thu" date="27 Mar 2008" low="13" high="22" text="Showers" code="11" />
<yweather:forecast day="Fri" date="28 Mar 2008" low="12" high="19" text="Showers" code="11" />
<yweather:forecast day="Sat" date="29 Mar 2008" low="11" high="15" text="Showers" code="11" />
<yweather:forecast day="Sun" date="30 Mar 2008" low="11" high="17" text="Showers" code="11" />
这部分中的day,low,high,text,code的值,谁能帮忙写个正则或其它方法取得他们的值<item>
<title>Conditions for Chengdu, CH at 2:00 pm CST</title>
<geo:lat>30.67</geo:lat>
<geo:long>104.02</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Chengdu__CH/*http://weather.yahoo.com/forecast/CHXX0016_c.html</link>
<pubDate>Wed, 26 Mar 2008 2:00 pm CST</pubDate>
<yweather:condition text="Fair" code="34" temp="24" date="Wed, 26 Mar 2008 2:00 pm CST" />
<description><![CDATA[
<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/34.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 24 C<BR />
<BR /><b>Forecast:</b><BR />
Wed - Partly Cloudy. High: 23 Low: 13<br />
Thu - Showers. High: 22 Low: 13<br />
Fri - Showers. High: 19 Low: 12<br />
Sat - Showers. High: 15 Low: 11<br />
Sun - Showers. High: 17 Low: 11<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Chengdu__CH/*http://weather.yahoo.com/forecast/CHXX0016_c.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]></description>
<yweather:forecast day="Wed" date="26 Mar 2008" low="13" high="23" text="Partly Cloudy" code="30" />
<yweather:forecast day="Thu" date="27 Mar 2008" low="13" high="22" text="Showers" code="11" />
<yweather:forecast day="Fri" date="28 Mar 2008" low="12" high="19" text="Showers" code="11" />
<yweather:forecast day="Sat" date="29 Mar 2008" low="11" high="15" text="Showers" code="11" />
<yweather:forecast day="Sun" date="30 Mar 2008" low="11" high="17" text="Showers" code="11" />
<guid isPermaLink="false">CHXX0016_2008_03_26_14_00_CST</guid>
</item>
</channel>
解决方案 »
- ASP.NET 中如何读取同一个服务器另外一个项目中的图片
- .NET MVC3 from mvc3 select
- 如何捕获这个异常,显示友好提示A potentially dangerous Request.Path value was detected from the
- CSDN~~~迷糊····这种异常都没处理?
- 紧急求助关于ASP.NET中,GRIDVIEW显示问题
- 一个js的问题,就是客户端文件控件<input type=file 这个东西。选择好文件后要js来判断是否格式符合
- 原来用vs.net2005做的怎么转成web application
- 点击日期选择按钮,弹出个网页对话框对日期进行选择,请问该怎么做?
- <AU:Editor>自动换行
- 求助!installshield中怎么样加入adsutil.vbs的脚本文件
- CSDN生成帖子功能是怎么做的?
- 哪位朋友能给份Microsoft Visual SourceSafe 2005的详细使用指南
这种切点读取的时候要报错,可以是应为:是特殊符号的原因