²Ù×÷XML£¬¶ÔXMLµÄÔöɾ¸Ä²é²Ù×÷¡£asp.net C#
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
namespace jiufen.Web.code
{
public class OperatingXML
{
XmlDocument xmlDoc = new XmlDocument();
//load xml file
private void LoadXml()
{
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("xml/User.xml"));//xmlµÄ¸ùĿ¼
}
//Ìí¼Ó½Úµã
public void AddElement()
{
LoadXml();
XmlNode xmldocSelect = xmlDoc.SelectSingleNode("user");
XmlElement el = xmlDoc.CreateElement("person"); //Ìí¼Óperson½Úµã
el.SetAttribute("name", "ÖܽÜÂ×"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ"name"
el.SetAttribute("sex", "ÄÐ"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ "sex"
el.SetAttribute("age", "52"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ "age"
XmlElement xesub1 = xmlDoc.CreateElement("pass"); //Ìí¼Óperson½ÚµãµÄÀïµÄ½Úµã
xesub1.InnerText = "22";//ÉèÖÃÎı¾½Úµã
el.AppendChild(xesub1);
XmlElement xesub2 = xmlDoc.CreateElement("Address");
xesub2.InnerText = "À¥Ã÷";//ÉèÖÃÎı¾½Úµã
el.AppendChild(xesub2);
xmldocSelect.AppendChild(el);
xmlDoc.Save(HttpContext.Current.Server.MapPath("xml/User.xml"));
}
//Ð޸Ľڵã
public void UpdateElement()
{
LoadXml();
XmlNodeList nodeList = xmlDoc.SelectSingleNode("user").ChildNodes;//»ñÈ¡bookstore½ÚµãµÄËùÓÐ×Ó½Úµã
foreach (XmlNode xn in nodeList)//±éÀúËùÓÐ×Ó½Úµã
{
XmlElement xe = (XmlElement)xn;//½«×Ó½ÚµãÀàÐÍת»»ÎªXmlElementÀàÐÍ
if (xe.GetAttribute("name") == "ÖܽÜÂ×")//Èç¹ûnameÊôÐÔÖ
Ïà¹ØÎĵµ£º
Èç¹û¶Ô½çÃæÃÀ¹Û³ÌÐò±È½Ï¸ß£¬ÊÖд´úÂëÊDz»¿É±ÜÃâµÄ¡£
µ«Èç¹û×öµÄÊÇһЩÏñÖ»ÊÇΪÁËÏÔʾ¡¢¿ØÖÆÖ®ÀàµÄ³ÌÐò£¬¿ÉÄܸü¿ìµÄ°Ñ³ÌÐòµ·¹Ä³öÀ´¾ÍºÃÁË¡£
wxwidgetsÓÐÕâÑùµÄÒ»¸ö¹¦ÄÜ£¬¾ÍÊÇÄÜÓÃxmlд³É½çÃæ¾ÍÄÜÏÔʾ
±à¼xrcµÄ¹¤¾ßÊÇwxformbuilder,¿ªÔ´Ãâ·ÑµÄ£¬Ò²×ã¹»ÓÃÁË£¬ÎÒÒ»¿ªÊ¼Ã»ÕÒµ½ÔõôÉú³Éxrc,ºóÀ´Ä³´ÎżȻ¿´µ½ÁËÏÂÃæ....ÔÀ´ÓÐc ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
namespace Maticsoft.DBUtility
{
/// <summary>
  ......
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öеķ½·¨TransmitFileÀ´½â¾öʹÓÃRespo ......
// MsXmlTest.cpp : ¶¨Òå¿ØÖÆ̨ӦÓóÌÐòµÄÈë¿Úµã¡£
//
#include "stdafx.h"
#include "MsXmlTest.h"
#include <clocale>
#include "comutil.h"
#import "msxml4.dll"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// ΨһµÄÓ¦ÓóÌÐò¶ÔÏó
CWinApp theApp;
using namespace std;
void WritePerson(MSXML2: ......