在C#中获取xml的价值 [英] Get value in xml In C#
本文介绍了在C#中获取xml的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
XDocument doc = XDocument.Load(URL); // xml在网址中加载非本地文件
示例
< main >
< file id = 15792 > ... < / file >
< 详细信息 value = 982kb< /跨度> f_type = .txt f_name = abcd / >
< / main >
如何获取 f_type 和 f_name
感谢提前!
解决方案
查看此链接。
http:// stackoverflow .com / questions / 1657082 / how-to-read-xml-attributes-in-c [ ^ ]
http://stackoverflow.com/questions/1600065/how-to-read-attribute-value-from-xmlnode-in-c [ ^ ]
XDocument doc = XDocument.Load(URL); // xml load in url not local file
Example
<main>
<file id="15792" >...</file>
<details value="982kb" f_type=".txt" f_name="abcd" />
</main>
How to get values in f_type and f_name
Thank In Advance!
解决方案
Check this links.
http://stackoverflow.com/questions/1657082/how-to-read-xml-attributes-in-c[^]
http://stackoverflow.com/questions/1600065/how-to-read-attribute-value-from-xmlnode-in-c[^]
这篇关于在C#中获取xml的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文