惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
C
Check Point Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
M
MIT News - Artificial intelligence
B
Blog RSS Feed
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
美团技术团队
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale

博客园 - miao~

C# 截取1位小数 ASP.NET 获取MSN联系人列表 扩展老赵的 直接通过User Control生成HTML 分页功能 小技巧在Repeater控件中找到对应模板内的控件 大型互联网网站架构心得之一:分 UML 序列图 sql存储过程教程 Create an ASP.NET AJAX Style Folder Explorer BS程序代码与安全与基本攻击/防御模式 RSS2.0规范 利用 .NET 3.5 的 Syndication 相关类读取 RSS Feeds 使用linq to xml 快速创建自己的Rss 代码设计简单规范 VS.PHP 在Visual Studio 下的 PHP 开发 IDE 工具 窥探jQuery——面向JavaScript程序员 开发一个适合Ajax+JSON+jQuery环境使用的多功能页码栏——jPagerBar-1.1.1 最实用的12条css技巧 不错的下拉列表.HTML控件和服务器控件都可以使用 两个粒度看Asp.net生命周期
利用 .NET 3.5 的 Syndication 相关类生成 RSS
miao~ · 2008-05-26 · via 博客园 - miao~

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.ServiceModel.Syndication;
using System.ServiceModel.Web;
using System.Xml;
using System.Collections.Generic;

public partial class CreateRss : System.Web.UI.Page
{
    
protected void Page_Load(object sender, EventArgs e)
    
{
            SyndicationFeed feed 
= new SyndicationFeed("Test Feed""This is a test feed"new Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now);
            SyndicationItem item 
= new SyndicationItem("Test Item""This is the content for Test Item"new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);

            List
<SyndicationItem> items = new List<SyndicationItem>();
            items.Add(item);
            feed.Items 
= items;

            XmlWriter rssWriter 
= XmlWriter.Create(Server.MapPath("RSS.XML"));
            Rss20FeedFormatter rssFormatter 
= new Rss20FeedFormatter(feed);
            rssFormatter.WriteTo(rssWriter);
            rssWriter.Close();
    }

}