Код: Выделить всё
const string RECENT_QUESTIONS = "https://stackoverflow.com/feeds";
XmlTextReader reader;
XmlDocument doc;
// Load the feed in
reader = new XmlTextReader(RECENT_QUESTIONS);
//reader.MoveToContent();
// Add the feed to the document
doc = new XmlDocument();
doc.Load(reader);
// Get the element
XmlNodeList feed = doc.GetElementsByTagName("feed");
// Loop through each item under feed and add to entries
IEnumerator ienum = feed.GetEnumerator();
List entries = new List();
while (ienum.MoveNext())
{
XmlNode node = (XmlNode)ienum.Current;
if (node.Name == "entry")
{
entries.Add(node);
}
}
// Send entries to the data grid control
question_list.DataSource = entries.ToArray();
Подробнее здесь: https://stackoverflow.com/questions/501 ... w-rss-feed
Мобильная версия