欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linq to XML 用一句話讀出RSS文章列表代碼

 更新時(shí)間:2010年06月17日 14:52:31   作者:  
Linq to XML 用一句話讀出RSS文章列表代碼
在頁(yè)面的 Page_Load() 方法中寫(xiě)上這句話就行了:
復(fù)制代碼 代碼如下:

new XDocument(
new XElement("ol",
from item in XDocument.Load("http://cnblogs.com/rss").Descendants("item")
select new XElement[]{
new XElement("li",
new XElement("a",(string)item.Element("title"),
new XAttribute("href",(string)item.Element("link"))
)
)
}
)
).WriteTo(new XmlTextWriter(Response.OutputStream,Encoding.UTF8));

相關(guān)文章

最新評(píng)論