我想为我最喜欢的网站创建rss,但问题是它的RSS XML包含在解析时破坏整个rs的第一行。如何删除读取数据的第一行。
因为我收到此错误:System does not support 'ISO-8859-2' encoding. Line 1, position 31.
void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
SyndicationFeed feed;
try {
using (XmlReader reader = XmlReader.Create(e.Result)) {
// I WOULD LIKE to delete some rows from the Result
feed = SyndicationFeed.Load(reader);
lista.ItemsSource = feed.Items;
}
} catch (WebException we) {
MessageBox.Show("The internet connection is down.");
}
}
答案 0 :(得分:1)
尝试使用:reader.MoveToContent()或reader.Skip()跳过文件开头的无关标记。