c#如何使用xelement读取xml属性

Fra*_*ayx 11 c# xml xelement windows-phone-7

我有一个带有此字符串的XML:

<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-tMQm4zsM-Yg/TdFEfG2y7GI/AAAAAAAAAT0/XGyQ8vFdVwY/s72-c/moorea-view.jpg" height="72" width="72" />
Run Code Online (Sandbox Code Playgroud)

如何使用XElement读取属性"url"?

Ste*_*cya 18

使用属性方法

yourxElement.Attribute("url").Value;
Run Code Online (Sandbox Code Playgroud)