C#读取XML?

扫码查看
本文介绍了C#读取XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我是初学者,我在C#中读取xml时遇到了严重的问题。

这是我的XML文档:

Hello,

I''m a beginner and i got serious issues with reading xml in C#.
This is my XML doc:

展开 | 选择 | Wrap | 行号

推荐答案

展开 | 选择 | Wrap | 行号





错误信息是什么? xmlwidth对象是null / empty吗?

如果我是你,我会使用SelectNode或SelectSingleNode方法从XML文件中获取值。但是,这些需要使用XPath。但在你的情况下,文件非常小,所以表达式不会太复杂。我建议你阅读w3schools.com关于XPath的教程。


一切顺利!

What''s the error message? Is the xmlwidth object null/empty?
If I were you I would use SelectNode or SelectSingleNode methods to fetch the values from the XML file. These, however require usage of XPath. But in your case the file is very small, so the expression won''t be too complex. I would suggest you read the tutorial on w3schools.com about XPath.

All the best!


这篇关于C#读取XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:28
查看更多