开发者

c# how to read xml attributes with xelement

开发者 https://www.devze.com 2023-03-07 04:24 出处:网络
I have a XML with this string: <media:thumbnail xmlns:media=\"http://search.yahoo.com/mrss/\" url=\"http://3.bp.blogspot.com/-tMQ开发者_开发知识库m4zsM-Yg/TdFEfG2y7GI/AAAAAAAAAT0/XGyQ8vFdVwY/s72-c

I have a XML with this string:

<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-tMQ开发者_开发知识库m4zsM-Yg/TdFEfG2y7GI/AAAAAAAAAT0/XGyQ8vFdVwY/s72-c/moorea-view.jpg" height="72" width="72" />

how can I read the attribute "url" with XElement?


Use Attribute method

yourxElement.Attribute("url").Value;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号