急求RSS实例一个,C#写的因为我没有做过.而且现在急得要学.
要求是写入数据库后读出来.象一般网站上的RSS功能一样.
希望有大鸟能帮一下我.谢谢大家指教.

解决方案 »

  1.   

    不懂,作个标学习下
    那位有也顺便给我一份[email protected]
      

  2.   

    把数据库记录读入DataSet,有一个方法可以生成xml序列,然后加上RSS的头尾标志。
    晚一点可以发一个示例,有需要的到http://www.dtable.com/DTableBBS/show.aspx?keyword=&addnew=true&rMviewid=5045这个页面留下Email
      

  3.   

    源代码http://www.codeproject.com/csharp/RssReader.asp
      

  4.   

    源代码
    http://www.codersource.net/asp_net_rss_feeds.aspx
    http://rollerweblogger.org/page/roller?entry=parsing_rss_with_net
      

  5.   

    如果你使用.NET 2.0,参考ASP.NET RSS Toolkit 
    http://blogs.msdn.com/dmitryr/archive/2006/03/26/561200.aspxScott Guthrie的示范
    http://weblogs.asp.net/scottgu/archive/2006/02/22/438738.aspx
      

  6.   

    StringBuilder winner = new StringBuilder();
    winner.Append("<?xml version='1.0' encoding='GB2312'?>\n"); 
    winner.Append("<rss version='2.0'>\n"); 
    winner.Append("<channel>\n"); 
    winner.Append("<title>拓文网络</title>\n"); 
    winner.Append("<description>栏目名字</description>\n"); 
    winner.Append("<language>zh-cn</language>\n"); 
    winner.Append("<generator>www.myTopWin.com</generator>\n"); 
    winner.Append("<link>http://"+Request.ServerVariables["SERVER_NAME"]+"</link> \n"); 
    winner.Append("<copyright>Copyright 2005-2006 www.myTopWin.com, All Rights  Reserved</copyright> \n"); 
    winner.Append("<pubDate>2006-4-1 11:29:09</pubDate>"); for ( int i=0;i < Mydataset.Tables[0].Rows.Count; i++ )
    {
    winner.Append("<item>\n");
    winner.Append("<title>&lt;![CDATA["+Format(Mydataset.Tables[0].Rows[i]["title"])+"]]&gt;</title>\n");
    winner.Append("<link>http://"+Request.ServerVariables["SERVER_NAME"]+"/Article/ShowArticle/"+Mydataset.Tables[0].Rows[i]["ClassID"]+"/"+Mydataset.Tables[0].Rows[i]["id"]+"_1.html</link>\n");

    winner.Append("<author />\n");
    winner.Append("<description>&lt;![CDATA["+Format(MyLeftFunction(Mydataset.Tables[0].Rows[i]["content"]))+"]]&gt;</description>\n");
    winner.Append("<guid />\n");
    winner.Append("<category />\n");
    winner.Append("</item>\n");
    } winner.Append("</channel>\n");
    winner.Append("</rss>\n"); Response.ContentType="text/xml";
    Response.Write(winner.ToString());
    }
      

  7.   

    RSS.NET: An open-source .NET class library for RSS feeds
    http://www.rssdotnet.com/
      

  8.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Rss.aspx.cs" Inherits="ly.WebProg.Rss" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        </div>
        </form>
    </body>
    </html>using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using ly.webdata.userlib;
    using ly.webdata;
    using DataLayer;namespace ly.WebProg
    {
        public partial class Rss : System.Web.UI.Page
        {
            bloglib user1 = new bloglib();
            string strRSS = "";
            protected void Page_Load(object sender, EventArgs e)
            {            
                Response.Clear();
                Response.ContentType = "application/xml"; // 输出并按xml数据显示
                Response.Write(getdata());
                Response.End();
            }        protected string getdata()
            {
                //数据获取部分
                DataSet ds = user1.GetTravelNoteInfo("jam");     //取游记           用户名可以从URL中获取
                DataSet photods = user1.GetPhotoInfo("jam");     //取图片            int num = ds.Tables[0].Rows.Count;
                int photonum = photods.Tables[0].Rows.Count;            //数据取示部分,可参见RSS 2.0的规范            //RSS的提要
                strRSS = strRSS + "<rss version=\"2.0\">";
                strRSS = strRSS + "<channel>";
                strRSS = strRSS + "<title>中华游</title>";
                strRSS = strRSS + "<Description>这里是描述</Description>";
                strRSS = strRSS + "<lastBuildDate>" + System.DateTime.Now + "</lastBuildDate>";
                strRSS = strRSS + "<cloud domain=\"202.193.64.67\" port=\"80\" path=\"/RPC2\" registerProcedure=\"pingMe\" protocol=\"soap\"></cloud>";
                strRSS = strRSS + "<ttl>60</ttl>";            //游记部分
                for (int i = 0; i < num; i++)
                {
                    strRSS = strRSS + "<item>";
                    strRSS = strRSS + "<title><![CDATA[" + ds.Tables[0].Rows[i]["TNI_Title"] + "]]></title>";
                    strRSS = strRSS + "<link>这里是link的内容</link> ";
                    strRSS = strRSS + "<description><![CDATA[" + ds.Tables[0].Rows[i]["TNI_Content"] + "]]></description>";
                    strRSS = strRSS + "<pubDate>" + Convert.ToDateTime(ds.Tables[0].Rows[i]["TNI_RelTime"].ToString()).ToString("yyyy-MM-dd HH:mm") + "</pubDate>";
                    strRSS = strRSS + "</item>";
                }            //图片部分
                for (int i = 0; i < photonum; i++)
                {
                    strRSS = strRSS + "<image>";
                    strRSS = strRSS + "<url>" + photods.Tables[0].Rows[i]["PI_Path"] + "</url> ";
                    strRSS = strRSS + "<title>" + photods.Tables[0].Rows[i]["PI_Title"] + "</title>";
                    strRSS = strRSS + "</image>";
                }            strRSS = strRSS + "</channel>";
                strRSS = strRSS + "</rss>";
                return strRSS;
            }
        }
    }
      

  9.   

    up专业C# qq群:1803321
    欢迎加入!