資源簡介
此項目中包含了對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??xm
?????文件???????1758??2007-12-19?18:16??xm
?????文件?????516096??2008-07-26?09:25??xm
?????文件???????1150??2007-12-19?18:19??xm
?????文件?????176128??2010-05-31?10:55??xm
?????文件??????52736??2010-05-31?10:55??xm
?????文件??????14328??2010-05-31?16:15??xm
?????文件????????490??2007-07-21?01:33??xm
?????文件???????1145??2010-05-31?13:52??xm
?????文件???????1406??2007-12-19?18:22??xm
?????文件???????1406??2010-03-06?17:17??xm
?????文件?????212992??2009-09-14?08:11??xm
?????文件??????31993??2008-07-26?09:25??xm
?????文件???????8704??2010-05-28?14:59??xm
?????文件??????28160??2010-05-28?14:59??xm
?????目錄??????????0??2010-05-31?15:19??xm
?????目錄??????????0??2010-05-31?15:19??xm
?????文件??????13133??2010-05-31?10:55??xm
?????文件??????16218??2010-05-31?10:55??xm
?????文件??????10761??2010-05-31?10:55??xm
?????文件???????5355??2010-05-28?13:54??xm
?????文件???????7937??2010-05-28?13:54??xm
?????文件???????8754??2010-05-28?13:54??xm
?????文件???????5228??2010-05-28?13:48??xm
?????文件???????3180??2010-05-31?16:15??xm
?????文件????????965??2010-05-31?10:55??xm
?????文件?????176128??2010-05-31?10:55??xm
?????文件???????3473??2010-05-31?10:55??xm
?????文件???????2324??2010-05-28?14:59??xm
?????文件??????52736??2010-05-31?10:55??xm
............此處省略43個文件信息
評論
共有 條評論