usingSystem;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.IO;usingSystem.Xml;namespaceUpdate
{public partial classForm1 : Form
{string filePath = Directory.GetCurrentDirectory() + @"uploadXML.xml";publicForm1()
{
InitializeComponent();
}//读取xml
private void button1_Click(objectsender, EventArgs e)
{if(File.Exists(filePath))
{
XmlDocument document= newXmlDocument();
document.Load(filePath);
XmlNode root=(XmlNode)document.DocumentElement;//循环展示成树状
xmlProcess(root,0);
}
}/** 循环展示成树状*/
private void xmlProcess(XmlNode root,inti)
{if (root == null)
{return;
}if (root isXmlElement)
{
listBox1.Items.Add(root.Name.PadLeft(root.Name.Length+i));if(root.HasChildNodes)
{