2012-05-10 104 views

回答

9

簡單 - 使用Attributes()方法:

foreach (var attribute in element.Attributes()) 
{ 
    string value = attribute.Value; 
    // ... 
} 
2

假設你想要的答案,this question

var img2 = feeds.Items 
    .SelectMany(i => i.ElementExtensions 
         .Select(e => e.GetObject<XElement>().Attribute("url").Value) 
       ) 
    .ToArray(); 
相關問題