从ASP.NET项目快速生成/发布RSS feed? [英] Quickly generate/publish RSS feeds from ASP.NET projects?

查看:107
本文介绍了从ASP.NET项目快速生成/发布RSS feed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,在时间轴上,重点是快速并且也愿意为此投入一些美元(这并不意味着我会支付正确的答案,而是针对商业产品:))。

Under a timeline, therefore the salient point is "quickly" and willing to throw some $ at it too (not meaning I'll pay the correct answer, but rather for a commercial product :) ).

寻找可在.NET Framework 2.0中使用的RSS feed生成器。理想情况下,它将易于使用(快速推断),但足够灵活以支持多种标准(在此页面的下方显示)。

Looking for an RSS feed generator usuable in .NET framework 2.0. Ideally it would be easy to use (inferred quick) but flexible enough to support the multiple standards (shown part way down this page).

我们在.NET中有业务类,并且希望发布RSS Feed在ASP.NET网站上。

We have the business classes in .NET and want to publish RSS feeds on the ASP.NET website.

有什么好软件吗?

不必免费。

必须支持.NET Framework 2.0

Any software that's good?
Doesn't have to be free.
Must support .NET framework 2.0

谢谢。

候选人和推理


  • Semweb -似乎不确定中断-可能不是个好主意

  • ROWLEX -基于Semweb,不喜欢使用不更新其核心引擎的东西

  • Linq2Rdf -对于快速解决方案似乎过于复杂

  • ASP.NET RSS工具包-进行了尝试,似乎生成了旧的/简化的格式-一段时间未触及

  • Semweb - appears to be on indefinite hiatus - likely not a good idea to pick up
  • ROWLEX - based on Semweb, not fond of using something whose core engine is not being updated
  • Linq2Rdf - appears overly complicated for a quick solution
  • ASP.NET RSS Toolkit - tried it and appears to generate an old/simplified format - hasn't been touched in a while

推荐答案

这是一些v我用来从BLL中的集合生成rss提要的b.net代码:

here's some vb.net code that I've used to generate a rss feed from a collection in our BLL:

Dim xws As New XmlWriterSettings()
xws.Encoding = Encoding.UTF8
Using xw As XmlWriter = XmlTextWriter.Create(XmlFileName, xws)

    xw.WriteStartDocument()
    xw.WriteStartElement("rss")
    xw.WriteAttributeString("version", "2.0")
    xw.WriteStartElement("channel")
    xw.WriteElementString("title", Title)
    xw.WriteElementString("link", Link)
    xw.WriteElementString("description", Description)
    xw.WriteElementString("managingEditor", Editor)

    Dim items As System.Collections.Generic.List(Of FolderDocuments) = FolderDocuments.GetFolderDocuments()
    If items IsNot Nothing Then
        For Each fd As FolderDocuments In items
            xw.WriteStartElement("item")
            xw.WriteElementString("title", fd.Title)
            xw.WriteElementString("description", fd.Intro)
            xw.WriteElementString("link", fd.Url)
            xw.WriteElementString("pubDate", fd.DateStart.ToString("R"))
            xw.WriteEndElement()
        Next
    Else
        xw.WriteStartElement("item")
        xw.WriteEndElement()
    End If

    xw.WriteEndElement()
    xw.WriteEndElement()
    xw.WriteEndDocument()
End Using

一个文件,但是您可以轻松地使用通用处理程序(.ashx)将参数传递给该文件,从而可以即时生成所需的rss供稿-使用xml writer的Response.Output。

This writes to a file, but you could easily use a generic handler (.ashx) to pass parameters to that would generate the required rss feed on the fly - use Response.Output for the xml writer.

这篇关于从ASP.NET项目快速生成/发布RSS feed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆