資源簡介
XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)XML文件操作實(shí)例 (C#源碼)

代碼片段和文件信息
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;
namespace?xml操作
{
????public?partial?class?AddForm?:?Form
????{
????????public?AddForm()
????????{
????????????InitializeComponent();
????????}
????????private?static?string?basePath?=?Application.StartupPath?+?“\\“?+?“Config\\data.xml“;
????????//添加元素
????????private?void?btn_Add_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????if?(txt_Name.Text?!=?““)
????????????????{
????????????????????string?node?=?cmb_Type.Text;
????????????????????string?mean?=?txt_Name.Text;
????????????????????bool?flag?=?false;
????????????????????if?(!xml.CheckValues(node?mean))
????????????????????{
????????????????????????flag?=?xml.AddNodes(node?mean);
????????????????????????DialogResult?result?=?DialogResult.Yes;
????????????????????????if?(flag)
????????????????????????{
????????????????????????????result?=?MessageBox.Show(“您還要繼續(xù)添加嗎?“?“提示“?MessageBoxButtons.YesNo?MessageBoxIcon.Information);
????????????????????????}
????????????????????????if?(result?==?DialogResult.No)
????????????????????????{
????????????????????????????((Form1)this.Owner).BindInfo();
????????????????????????????this.Close();
????????????????????????}
????????????????????}
????????????????????else
????????????????????{
????????????????????????MessageBox.Show(“已存在!“?“警告“?MessageBoxButtons.OK?MessageBoxIcon.Warning);
????????????????????????txt_Name.Text?=?““;
????????????????????}
????????????????}
????????????????else
????????????????{
????????????????????MessageBox.Show(“名稱不能為空!“?“提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????}
????????????}
????????????catch
????????????{
????????????????MessageBox.Show(“系統(tǒng)故障!“);
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????460800??2010-05-25?22:28??xm
?????文件?????340480??2010-05-25?22:28??xm
?????文件??????27238??2010-05-25?22:28??xm
?????文件???????2029??2010-05-17?17:05??xm
?????文件???????4527??2010-05-16?15:38??xm
?????文件???????5814??2010-05-16?15:38??xm
?????文件???????1887??2010-05-17?17:25??xm
?????文件????????111??2010-05-17?21:26??xm
?????文件????????218??2010-04-06?20:02??xm
?????文件??????28160??2010-05-25?22:28??xm
?????文件??????54784??2010-05-25?22:28??xm
?????文件??????14328??2010-05-25?22:25??xm
?????文件????????490??2009-06-11?05:14??xm
?????文件???????1305??2010-03-09?11:35??xm
?????文件???????6726??2010-05-17?22:30??xm
?????文件??????10780??2010-05-17?21:39??xm
?????文件??????12698??2010-05-17?21:39??xm
?????文件????????180??2010-05-16?15:40??xm
?????文件????????735??2010-05-25?22:25??xm
?????文件????????907??2010-05-17?21:53??xm
?????文件??????28160??2010-05-25?22:28??xm
?????文件???????4461??2010-05-17?21:53??xm
?????文件??????54784??2010-05-25?22:28??xm
?????文件????????180??2010-05-15?16:49??xm
?????文件????????490??2010-02-26?22:51??xm
?????文件???????1350??2010-02-26?22:50??xm
?????文件???????2868??2010-02-26?22:50??xm
?????文件???????5612??2010-02-26?22:50??xm
?????文件???????1094??2010-02-26?22:51??xm
?????文件????????249??2010-02-26?22:50??xm
............此處省略20個(gè)文件信息
評(píng)論
共有 條評(píng)論