我正在尝试获取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;
}
答案 0 :(得分:2)
你可能想要冲洗你的作家......
var rssFormatter = new Rss20FeedFormatter(feed, false);
var output = new StringBuilder();
using (var writer = XmlWriter.Create(output, new XmlWriterSettings { Indent = true }))
{
rssFormatter.WriteTo(writer);
writer.Flush();
return output;
}