0
とRSSフィードからリンクを取得しようとすると:私はそうのようなRSSフィードからリンクを取得しようとしていますSyndicationitem
<item>
<title>
Mothers CAN wear the same clothes as their daughters
</title>
<link>
http://www.dailymail.co.uk/femail/article-4408430/Mothers-wear-clothes-daughters.html?ITO=1490&ns_mchannel=rss&ns_campaign=1490
</link>
<description>
Stylist Trinny, 53, appeared on This Morning in a pair of white striped culottes from Urban Outfitters that she bought after admiring them on her 13-year-old daughter, Lyla Elichaoff.
</description>
<enclosure url="http://i.dailymail.co.uk/i/pix/2017/04/13/13/3F36FB3200000578-0-image-a-58_1492086235218.jpg" type="image/jpeg" length="9078"/>
<pubDate>Thu, 13 Apr 2017 13:38:02 +0100</pubDate>
<guid>
http://www.dailymail.co.uk/femail/article-4408430/Mothers-wear-clothes-daughters.html?ITO=1490&ns_mchannel=rss&ns_campaign=1490
</guid>
<media:description/>
<media:thumbnail url="http://i.dailymail.co.uk/i/pix/2017/04/13/13/3F36FB3200000578-0-image-a-58_1492086235218.jpg" width="154" height="115"/>
<media:credit scheme="urn:ebu">Ken McKay/ITV/REX/Shutterstock</media:credit>
<media:content type="image/jpeg" url="http://i.dailymail.co.uk/i/pix/2017/04/13/13/3F36FB3200000578-0-image-a-58_1492086235218.jpg"/>
</item>
のRSSフィード項目をループに私のコード
private void button2_Click(object sender, EventArgs e)
{
string url = textBox1.Text;
XmlReader reader = XmlReader.Create(url);
SyndicationFeed feed = SyndicationFeed.Load(reader);
reader.Close();
foreach (SyndicationItem item in feed.Items)
{
String subject = item.Links.
articletext.Text = subject;
}
}
私はしようとしました 'item.links.tostring();'と 'item.link;'どちらもうまくいかないようですが、どうすればRSSフィードのリンクを取得できますか?
? xmlのノードは 'items'で' items'は 'links'と同じではないことに注意してください。 –
Item.Link.ToString();私は次のようになります:System.ServiceModel.Syndication.NullNotAllowedCollection'1 [System.ServiceModel.Syndication.SyndicationLink] – 4334738290
正しくデバッグすれば、どのような応答が得られているか簡単に確認できます。あなたが価値を得るために書く必要があるもの。見るために追加する値を確認するために、ステップバイステップで確認してください。 –