1
我想獲取RSS XML的原始字符串。我嘗試了下面,但我的字符串生成器結束了空白。什麼是正確的方法來做到這一點?從Rss20FeedFormatter獲取RSS/XML的原始字符串?
var rssFormatter = new Rss20FeedFormatter(feed, false);
var output = new StringBuilder();
using (var writer = XmlWriter.Create(output, new XmlWriterSettings { Indent = true }))
{
rssFormatter.WriteTo(writer);
return output;
}