c# 读取xml的内容 - .NET技术 / C#
XML code: <?xml version="1.0" encoding="utf-8"?> <node> <soft> <version>1.0.0.0</version> <register>True</register> </soft> <!--阅读历史--> <readerLater> <book> <path>E:\book\天王.txt</path> <date>2010-4-12</date> <lastPageID>135</lastPageID> </book> <book> <path>E:\book\神话.txt</path> <date>2010-4-12</date> <lastPageID>135</lastPageID> </book> </readerLater> <!--待读文件--> <WaitingReading> <book> <path>e:\book\恶魔法则.txt</path> </book> </WaitingReading> </node> 我想读取readerLater节点的内容,不好意思,小弟今天第一次接触XML,实在不懂。在网上找了例子,基本都是用循环的,有没有一个直接的方法,类似于js的GetElementByID的?
XmlDocument doc= new XmlDocument(); doc.Load(""); foreach (XmlNode node in doc.GetElementsByTagName("book")) {}引用 XmlDocument doc= new XmlDocument(); doc.Load(""); foreach (XmlNode node in doc.GetElementsByTagName("book")) {} node.InnerText using S
相关问答:
请问VFP中如何调用C/C++函数? 你要调用什么功能的函数?要看看VFP中有没有对应的函数,如果有就省着再调用了。如果没有,可以将C/C++函数写个DLL或FLL,然后在VFP调用即可。 十豆三 老师,怎么才能修改自己的 ......
从数据库中查询一张表的数据 select 部门,姓名 from tb 如何才能生成下面的xml格式 XML code: <folder state="unchecked" label="全部"> <folder state="unchecked&qu ......
有一10*10矩阵,除去第一个点(0,0)和最后一点(9,9),还有八个点为1,其他都为0,要求用二维数组表示。八个点是随机生成的,编写相关程序表示矩阵所有可能情况。 真心求教各位高手,哎!本人太菜了!呵呵!
......
在根目录/lib中存放一个log.c,log.h,并用下面的语句: gcc -c log.c ar crv liblog.a log.o 编译出一个liblog.a静态库,然后在文件夹:/testfile中创建一个test.c和testc.c,test.c中引用了testc.c中定义的方法 ......
谁能帮我把下面这些代码改成VB形式的,多谢了,急用~~ #include "stdlib.h" #include "math.h" #include "stdio.h" float objfx(float x[]); void constraint(float x[],float g ......