Diese Methode läd einen RSS Feed in ein XMLDocument.
Benötigte Namespaces:
using System.Xml;
using System.Net;
/// <summary>
/// Gets the feed.
/// </summary>
/// <param name="rssUrl">The RSS URL.</param>
/// <returns></returns>
private static XmlDocument GetFeed(string rssUrl)
{
var xmlDoc = new XmlDocument();
var rssFeed = WebRequest.Create(rssUrl) as HttpWebRequest;
if (rssFeed != null)
xmlDoc.Load(rssFeed.GetResponse().GetResponseStream());
return xmlDoc;
}
Kommentare zum Snippet