我有一个带有这个字符串的 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" />
如何使用 XElement 读取属性“url”?
最佳答案
使用Attribute方法
yourxElement.Attribute("url").Value;
关于c# 如何使用 xelement 读取 xml 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6057770/