ASP.NET 生成 RSS Feed

来源:网络整理 责任编辑:栏目编辑 发表时间:2013-07-01 19:45 点击:

  前段时间在写RSS Feed。

  经过了几次的修改,把相关的代码写成了单独的类。感觉重用时还算比较方便的。于是贴出来,大家一起研究研究。以下是RssBase.cs类:

  1using System;
  2using System.Collections.Generic;
  3using System.Xml;
  4
  5namespace MyMedia.Utilities
  6{
  7    public class RssBase
  8    {
  9        RssBase constructor#region RssBase constructor
 10        public RssBase(XmlTextWriter rssWriter)
 11        {
 12            this.rssWriter = rssWriter;
 13        }
 14        public RssBase(XmlTextWriter rssWriter, bool hasMedia, IList<ItemInfo> items)
 15        {
 16            this.rssWriter = rssWriter;
 17            this.hasMedia = hasMedia;
 18            this.items = items;
 19        }
 20        #endregion
 21
 22        [Serializable]
 23        public sealed class ItemInfo
 24        {
 25            ItemInfo constructor#region ItemInfo constructor
 26            public ItemInfo() { }
 27            public ItemInfo(string itemTitle, string itemLink, string itemDescription, string itemPubDate, string itemAuthor, string itemGuid)
 28            {
 29                this.itemTitle = itemTitle;
 30                this.itemLink = itemLink;
 31                this.itemDescription = itemDescription;
 32                this.itemAuthor = itemAuthor;
 33                this.itemGuid = itemGuid;
 34                this.itemPubDate = itemPubDate;
 35            }
 36            public ItemInfo(string itemTitle, string itemLink, string itemDescription, string itemPubDate, string itemAuthor,
 37                            string itemGuid, string mediaContentUrl, string mediaTitle, string mediaDescription,
 38                            string mediaThumbUrl, string mediaThumbWidth, string mediaThumbHeight, string mediaAuthor)
 39            {
 40                this.itemTitle = itemTitle;
 41              

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • 浅析.NET下XML数据访问新机制
    • asp.net 面试+笔试题目第1/2页
    • C# 邮件地址是否合法的验证
    • asp.net 设置GridView的选中行的实现代码
    • C#高级编程:数据库连接[1]
    • 经典C++程序1
    • IIS 自动回收导致后台定时器失效的问题解决
    • ASP.NET&#160;GridView列表代码示例
    • Asp.net MVC源码分析--Action Filter的链式调用
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1