为什么 MS Syndication 类不接受有效的 RSS 提要?
public static Stream GetResponseStream(string url)
{
var uri = new Uri(url, true);
WebRequest request = WebRequest.Create(uri);
request.Method = WebRequestMethods.Http.Get;
WebResponse response = request.GetResponse();
return response.GetResponseStream();
}
public static void GetRSS()
{
using (Stream stream1 = GetResponseStream("http://www.lostfilm.tv/rssdd.xml"))
{
try
{
XmlReader xmlReader = XmlReader.Create(stream1);
var feeds = SyndicationFeed.Load(xmlReader);
}
catch (Exception ex)
{
// Error :(
}
}
}
RSS 本身是有效的:
http://validator.w3.org/appc/check.cgi?url=http%3A%2F%2Fwww.lostfilm.tv%2Frssdd.xml