• 大小: 1010KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-04
  • 语言: 其他
  • 标签: xml  

资源简介

此项目中包含了对XML的各种基本操作,其中还结合TreeView等控件,详细的介绍了XML的各种使用方式,让你通过一个项目充分理解XML的使用.同时项目中还利用到枚举 分层等技术,共大家参考学习.

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using xmlManager;
using System.Threading;
using System.xml;

namespace MyTest1
{
    public partial class Form1 : Form
    {
        Manager xmlManger = new Manager();
        private xmlNode curentNode = null;
        public Form1()
        {
            Welcome q = new Welcome();
            q.Show();
            Thread.Sleep(3000);
            q.Close();
            InitializeComponent();
            this.skinEngine1.SkinFile = “vistaGreen.ssk“;
            this.vistaClock.style = CNPOPSOFT.Controls.VistaClock.VistaClockstyle.银色;
            xmlManger.Load(“Note.xml“);
            this.cmbSearch.DataSource = Contants.items;
            this.cmbCondition.DataSource = Contants.items4;
            ClearTreeView();
            ImageList li = new ImageList();
            Image a=Image.FromFile(“Alpha_Ttao.ico“);
            Image d = Image.FromFile(“CustomButton.ico“);
            Image d1 = Image.FromFile(“show.qq.com_favicon.ico“);
            Image d2 = Image.FromFile(“knowledgesearchsmall.ico“);
            Image d3 = Image.FromFile(“PushMsgInfo.ico“);
            li.Images.Add(a);
            li.Images.Add(d);
            li.Images.Add(d1);
            li.Images.Add(d2);
            li.Images.Add(d3);
            this.treeView1.ImageList = li;
        }

        private void btnInsertEntity_Click(object sender EventArgs e)
        {
            Form2 q = new Form2();
            if (DialogResult.OK == q.ShowInsert(WorkType.InsertDate null null xmlManger))
            {
                ClearTreeView();
            }
        }
        private void ClearTreeView()
        {
            this.treeView1.Nodes.Clear();
            xmlManger.doc.Load(“Note.xml“);
            xmlManger.ShowNode(xmlManger.doc.DocumentElementthis.treeView1);
            this.label1.Text = “你好!今天是:“+DateTime.Now.Date.ToShortDateString();
        }

        private void btnSearchAll_Click(object sender EventArgs e)
        {
            if (curentNode == null)
                return;
            Enitity ent = new Enitity();
            ent.Time = curentNode.ParentNode.Attributes[0].Value;
            ent.Corse = curentNode.Attributes[0].Value;
            foreach (xmlNode xnode in this.curentNode.ChildNodes)
            {
                if (xnode is xmlElement && xnode.Name == “具体内容“)
                {
                    ent.Contant = xnode.InnerText;
                }
                if (xnode is xmlElement && xnode.Name == “经验心得“)
                {
                    ent.Experience = xnode.InnerText;
                }
            }
            Form2 q = new Form2();
            q.ShowInsert(WorkType.Brows entnullxmlManger);
        }

        private void treeView1_NodeMouseClick(object sender Tr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3158  2009-08-04 09:24  xml项目\MyTest1\bin\Debug\Alpha_Ttao.ico

     文件       1758  2007-12-19 18:16  xml项目\MyTest1\bin\Debug\CustomButton.ico

     文件     516096  2008-07-26 09:25  xml项目\MyTest1\bin\Debug\IrisSkin2.dll

     文件       1150  2007-12-19 18:19  xml项目\MyTest1\bin\Debug\knowledgesearchsmall.ico

     文件     176128  2010-05-31 10:55  xml项目\MyTest1\bin\Debug\MyTest1.exe

     文件      52736  2010-05-31 10:55  xml项目\MyTest1\bin\Debug\MyTest1.pdb

     文件      14328  2010-05-31 16:15  xml项目\MyTest1\bin\Debug\MyTest1.vshost.exe

     文件        490  2007-07-21 01:33  xml项目\MyTest1\bin\Debug\MyTest1.vshost.exe.manifest

     文件       1145  2010-05-31 13:52  xml项目\MyTest1\bin\Debug\Note.xml

     文件       1406  2007-12-19 18:22  xml项目\MyTest1\bin\Debug\PushMsgInfo.ico

     文件       1406  2010-03-06 17:17  xml项目\MyTest1\bin\Debug\show.qq.com_favicon.ico

     文件     212992  2009-09-14 08:11  xml项目\MyTest1\bin\Debug\VistaClockProject.exe

     文件      31993  2008-07-26 09:25  xml项目\MyTest1\bin\Debug\vistaGreen.ssk

     文件       8704  2010-05-28 14:59  xml项目\MyTest1\bin\Debug\xmlManager.dll

     文件      28160  2010-05-28 14:59  xml项目\MyTest1\bin\Debug\xmlManager.pdb

     目录          0  2010-05-31 15:19  xml项目\MyTest1\bin\Debug

     目录          0  2010-05-31 15:19  xml项目\MyTest1\bin

     文件      13133  2010-05-31 10:55  xml项目\MyTest1\Form1.cs

     文件      16218  2010-05-31 10:55  xml项目\MyTest1\Form1.Designer.cs

     文件      10761  2010-05-31 10:55  xml项目\MyTest1\Form1.resx

     文件       5355  2010-05-28 13:54  xml项目\MyTest1\Form2.cs

     文件       7937  2010-05-28 13:54  xml项目\MyTest1\Form2.Designer.cs

     文件       8754  2010-05-28 13:54  xml项目\MyTest1\Form2.resx

     文件       5228  2010-05-28 13:48  xml项目\MyTest1\MyTest1.csproj

     文件       3180  2010-05-31 16:15  xml项目\MyTest1\obj\Debug\MyTest1.csproj.FileListAbsolute.txt

     文件        965  2010-05-31 10:55  xml项目\MyTest1\obj\Debug\MyTest1.csproj.GenerateResource.Cache

     文件     176128  2010-05-31 10:55  xml项目\MyTest1\obj\Debug\MyTest1.exe

     文件       3473  2010-05-31 10:55  xml项目\MyTest1\obj\Debug\MyTest1.Form1.resources

     文件       2324  2010-05-28 14:59  xml项目\MyTest1\obj\Debug\MyTest1.Form2.resources

     文件      52736  2010-05-31 10:55  xml项目\MyTest1\obj\Debug\MyTest1.pdb

............此处省略43个文件信息

评论

共有 条评论