摘要:
引用:http://topic.csdn.net/u/20080311/16/358d97b9-1e56-4925-aea0-43f9734b3e03.htmlforeach (XmlNode xn in nodeList)//遍历所有子节点 { XmlElement xe = xn as XmlElement;//最好不好用强制转换,建议使用as,这样如果转不过去话,就是null,不会报异常if(xe!=null) //这样判断以下是否为null,或者你可以if(xe==null) return ;直接返回或做其他处理{ Keyname = xe.Attributes["key&q 阅读全文
摘要:
引用:http://www.qqread.com/csharp/p359862.html已知有一个xml文件(bookstore.xml)如下: <?xml version="1.0" encoding="gb2312"?> <bookstore> <book genre="fantasy" ISBN="2-3631-4"> <title>Oberon's Legacy</title> <author>。已知有一个XML文件(books 阅读全文
摘要:
引用:http://xtuhuajx.blog.163.com/blog/static/25504754200851210120611/usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Xml;usingSystem.Threading;usingSystem.Data.SqlClient;namespaceTestFor 阅读全文