91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

XML在我們的程序中用到的越來越多,因為它存儲、讀取、修改都比較方便。本例是就是對Xml的增刪改查...

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.IO;
using?System.xml;
using?System.Runtime.Serialization.Formatters.Binary;

namespace?Parsexml
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????IList?studentList;
????????///?
????????///?創建
????????///?

????????///?
????????///?
????????private?void?btnCreate_Click(object?sender?EventArgs?e)
????????{
????????????if?(!InputCheck())
????????????{
????????????????return;
????????????}
????????????if?(File.Exists(“Student.xml“)?&&?MessageBox.Show(“文件已經存在,是否覆蓋?“?“提示“?MessageBoxButtons.YesNo?MessageBoxIcon.Information)?==?DialogResult.No)
????????????????return;
????????????Student?s?=?BindData();
????????????xmlFunc.Createxml(“Student.xml“?s);
????????????ShowData(“Student.xml“);
????????}

????????///?
????????///?綁定數據
????????///?

????????///?
????????private?Student?BindData()
????????{
????????????Student?s?=?new?Student();
????????????s.SID?=?Convert.ToInt32(nudSID.Value);
????????????s.Sex?=?cboSex.Text;
????????????s.Name?=?txtName.Text.Trim();
????????????s.Age?=?Convert.ToInt32(nudAge.Value);
????????????s.Address?=?txtAddress.Text.Trim();
????????????return?s;
????????}

????????///?
????????///?添加
????????///?

????????///?
????????///?
????????private?void?btnAdd_Click(object?sender?EventArgs?e)
????????{
????????????if?(!InputCheck())
????????????{
????????????????return;
????????????}
????????????if?(!File.Exists(“Student.xml“))
????????????{
????????????????MessageBox.Show(“沒有xml文件,請先點擊創建!“?“提示?“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????Student?s?=?BindData();
????????????xmlFunc.Append(“Student.xml“?s);
????????????ShowData(“Student.xml“);
????????}

????????///?
????????///?刪除
????????///?

????????///?
????????///?
????????private?void?btnDel_Click(object?sender?EventArgs?e)
????????{
????????????string?sid?=?string.Empty;
????????????if?(treeView1.SelectedNode?==?null)
????????????{
????????????????MessageBox.Show(“請先選擇學員!“?“提示“?MessageBoxButtons.OK?MessageBoxIcon.Information);
????????????????return;
????????????}
????????????if?(treeView1.SelectedNode.Level?==?0)
????????????????sid?=?treeView1.SelectedNode.Tag.ToString();
????????????else
????????????????sid?=?treeView1.SelectedNode.Parent.Tag.ToString();
????????????if?(MessageBox.Show(“確定要刪除該學員嗎?“?“提示“?MessageBoxButtons.YesNo?MessageBoxIcon.Information)?==?DialogResult.No)
????????????????return;

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????32768??2010-04-11?12:09??Parsexml\Parsexml\bin\Debug\Parsexml.exe

?????文件??????42496??2010-04-11?12:09??Parsexml\Parsexml\bin\Debug\Parsexml.pdb

?????文件???????5632??2005-11-11?22:25??Parsexml\Parsexml\bin\Debug\Parsexml.vshost.exe

?????文件???????1065??2010-04-11?12:03??Parsexml\Parsexml\bin\Debug\Student.dat

?????文件????????697??2010-04-11?16:32??Parsexml\Parsexml\bin\Debug\Student.xml

?????文件???????8494??2010-04-11?12:08??Parsexml\Parsexml\Form1.cs

?????文件??????12565??2009-07-12?17:14??Parsexml\Parsexml\Form1.Designer.cs

?????文件???????5814??2009-07-12?17:14??Parsexml\Parsexml\Form1.resx

?????文件????????842??2010-04-11?11:56??Parsexml\Parsexml\obj\Debug\Parsexml.csproj.GenerateResource.Cache

?????文件??????32768??2010-04-11?12:09??Parsexml\Parsexml\obj\Debug\Parsexml.exe

?????文件????????180??2009-07-12?17:17??Parsexml\Parsexml\obj\Debug\Parsexml.Form1.resources

?????文件??????42496??2010-04-11?12:09??Parsexml\Parsexml\obj\Debug\Parsexml.pdb

?????文件????????180??2009-07-10?16:05??Parsexml\Parsexml\obj\Debug\Parsexml.Properties.Resources.resources

?????文件????????275??2010-04-11?12:09??Parsexml\Parsexml\obj\Parsexml.csproj.FileList.txt

?????文件???????3299??2009-07-10?16:34??Parsexml\Parsexml\Parsexml.csproj

?????文件????????467??2009-07-10?16:01??Parsexml\Parsexml\Program.cs

?????文件???????1188??2009-07-10?16:01??Parsexml\Parsexml\Properties\AssemblyInfo.cs

?????文件???????2870??2009-07-10?16:01??Parsexml\Parsexml\Properties\Resources.Designer.cs

?????文件???????5612??2009-07-10?16:00??Parsexml\Parsexml\Properties\Resources.resx

?????文件???????1091??2009-07-10?16:01??Parsexml\Parsexml\Properties\Settings.Designer.cs

?????文件????????249??2009-07-10?16:00??Parsexml\Parsexml\Properties\Settings.settings

?????文件???????1587??2010-04-11?11:56??Parsexml\Parsexml\Student.cs

?????文件???????6541??2010-04-11?11:56??Parsexml\Parsexml\xmlFunc.cs

?????文件????????913??2009-07-10?16:01??Parsexml\Parsexml.sln

????..A..H.?????15872??2010-04-11?12:09??Parsexml\Parsexml.suo

?????目錄??????????0??2010-04-11?16:31??Parsexml\Parsexml\obj\Debug\Refactor

?????目錄??????????0??2010-04-11?16:31??Parsexml\Parsexml\obj\Debug\TempPE

?????目錄??????????0??2010-04-11?16:31??Parsexml\Parsexml\bin\Debug

?????目錄??????????0??2010-04-11?16:31??Parsexml\Parsexml\obj\Debug

?????目錄??????????0??2010-04-11?16:31??Parsexml\Parsexml\bin

............此處省略7個文件信息

評論

共有 條評論