手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >Linq to XML 用一句话读出RSS文章列表代码
Linq to XML 用一句话读出RSS文章列表代码
摘要:在页面的Page_Load()方法中写上这句话就行了:复制代码代码如下:newXDocument(newXElement("ol",from...

在页面的 Page_Load() 方法中写上这句话就行了:

复制代码 代码如下:

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));

【Linq to XML 用一句话读出RSS文章列表代码】相关文章:

asp.net下常用的加密算法MD5、SHA-1应用代码

asp.net(C#) 生成随机验证码的代码

c# .net 生成图片验证码的代码

Asp.net下载功能的解决方案代码

高仿Windows Phone QQ登录界面实例代码

Asp.net 通用万级数据分页代码[修正下载地址]

在.NET中利用XMLHTTP下载文件的代码

asp.net输出重写压缩页面文件实例代码

常用的在数据库中建立无限级树形菜单的asp.net代码

asp.net 购物车实现详细代码

精品推荐
分类导航