读取XML节点 - .NET技术 / C#
谁能给个C#中读取XML节点的范例!
XmlDocument pXmlDocument = new XmlDocument();
pXmlDocument.Load(C:\\Config.xml);
XmlNode pDbConnNode = pXmlDocument.SelectSingleNode("ProConfig/Database/Conn");
m_sConn = pDbConnNode.InnerText;
XML code:
Ma Jin Hu 239000 Feng Huang StreetChu Zhou City ANHUI Wang Tian 239000 Lang Ya StreetHe Fei City ANHUI Zou Wen Biao 100000 Sai Di StreetBei Jin CityBei Jin
C# code:
using System ;using System.Drawing ;using System.Collections ;using System.ComponentModel ;using System.Windows.Forms ;using System.Data ;using System.Xml ;public class Form1 : Form{private Button button1 ;private ListView Listview1 ;private System.ComponentModel.Container components = null ;public Form1 ( ){//初始化窗体中的各个组件InitializeComponent ( ) ;}//清除程序中使用过的资源protected override void Dispose ( bool disposing ){if ( disposing ){if ( components != null ) {components.Dispose ( ) ;}}base.Dispose ( disposing ) ;}private void InitializeComponent ( ){button1 = new Button ( ) ;Listview1 = new ListView ( ) ;SuspendLayout ( ) ;button1.Anchor = ( ( AnchorStyles.Bottom | AnchorStyles.Left ) | AnchorStyles.Right ) ;b
相关问答:
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式文件
<folder state="unchecked" label="全部">
<folder state="unchecked" isBra ......
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
思路:要用c#生成一个播放机的播放列表的xml,例如:
<daty datys='2010-04-05' datye='2010-05-01' > //这是播放的日期段
<time times='01:12:00' timee='02:30:00'> ......
我从后台获取了下边一段html代码但我现在想吧<span></span>里的内容过滤去掉谁能给个好的,简单的方法
多谢各位了……
<html>
<body>
<div>
<sp ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......