簡體   English   中英

得到 <content:encoded> 使用rss feed

[英]Getting the <content:encoded> using rss feed

  private void UpdateFeedList(string feedXML)
    {
        StringReader stringReader = new StringReader(feedXML);
        XmlReader xmlReader = XmlReader.Create(stringReader);
        SyndicationFeed feed = SyndicationFeed.Load(xmlReader);

        Deployment.Current.Dispatcher.BeginInvoke(() =>
        {
            feedListBox.ItemsSource = feed.Items;
        });
    }

這是我用來獲取提要的代碼,它可以正常工作,我使用轉換器將Summary.Text綁定到文本塊,但是我需要獲取內容的方式,大量搜索和一些代碼可以工作,但是不是我想要的方式,所以任何幫助都會很棒,在此先感謝。

為了使您可以在某些標簽中顯示內容,請使用Regex.Match。

your_content = Regex.Match(Item_with_your_content, @"<img\s+src='(.+)'\s+border='0'\s+/>").Groups[1].Value,

此代碼將獲取供稿的代碼。 更改為所需的標簽。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM