【问题标题】:c# how to read xml attributes with xelementc#如何用xelement读取xml属性
【发布时间】:2011-08-28 19:17:15
【问题描述】:

我有一个带有这个字符串的 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”?

【问题讨论】:

    标签: c# xml windows-phone-7 xelement


    【解决方案1】:

    使用Attribute方法

    yourxElement.Attribute("url").Value;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-14
      • 1970-01-01
      • 2012-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多