资源简介
这是本人自学习CSharp以来的首次程序 内部含有很多的控件的使用 如ListView Toolbar ContexMenu 还有操作注册表的信息 通讯录的保存方式是以xml文档的方式保存
大家共同学习!O(∩_∩)O哈哈~

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.xml;
using System.Windows.Forms;
namespace CSharp
{
public partial class addName : Form
{
xmlDocument xmlDoc = new xmlDocument();//定义xml文档类对象
public xmlNode rootNode;//文档中单个节点对象
public addName(MainForm parent)
{
InitializeComponent();
this.parentForm = parent;
this.DialogResult = DialogResult.Cancel;
}
//退出
private void btnExit_Click(object sender EventArgs e)
{
MainForm.bOK = false;
this.Dispose();
}
public void createxml(string strName)
{
//在创建一个节点时之所以前面要加上str是考虑会输入首字母是数字的姓名
//在xml规范中是不允许以首字母为数字来命名节点名字的
xmlNode Name = xmlDoc.CreateElement(“str“+strName);
xmlNode Gender = xmlDoc.CreateElement(“Gender“);
xmlNode EMail = xmlDoc.CreateElement(“EMail“);
xmlNode QQ = xmlDoc.CreateElement(“QQ“);
xmlNode Mobile = xmlDoc.CreateElement(“Mobile“);
Name.AppendChild(Gender);
Name.AppendChild(EMail);
Name.AppendChild(QQ);
Name.AppendChild(Mobile);
rootNode.AppendChild(Name);
xmlDoc.AppendChild(rootNode);
}
//确定
private void btnOk_Click(object sender EventArgs e)
{
//xmlLib xml = new xmlLib.xmlbase();
if(this.parentForm.bEdit==true)
{
this.parentForm.Curstruct.ItemName = txtName.Text;
this.parentForm.Curstruct.ItemGender = comboGender.Text;
this.parentForm.Curstruct.ItemEMail = txtEMail.Text;
this.parentForm.Curstruct.ItemQQ = txtQQ.Text;
this.parentForm.Curstruct.ItemMobile = txtMobile.Text;
bool bIsEqual=false;
if (this.parentForm.Curstruct.ItemName == this.parentForm.Oldstruct.ItemName)
{
if (this.parentForm.Curstruct.ItemEMail == this.parentForm.Oldstruct.ItemEMail)
{
if (this.parentForm.Curstruct.ItemGender == this.parentForm.Oldstruct.ItemGender)
{
if (this.parentForm.Curstruct.ItemQQ == this.parentForm.Oldstruct.ItemQQ)
{
if (this.parentForm.Curstruct.ItemMobile == this.parentForm.Oldstruct.ItemMobile)
{
bIsEqual = true;
}
}
}
}
}
if (bIsEqual==true)//编辑完成后没有更改
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 99678 2010-09-07 11:57 CSharp\1279286287_google_voice.ico
文件 9086 2010-09-07 15:11 CSharp\addName.cs
文件 9445 2010-09-07 14:43 CSharp\addName.Designer.cs
文件 155634 2010-09-07 14:43 CSharp\addName.resx
文件 14328 2010-09-07 15:14 CSharp\bin\Debug\CSharp.vshost.exe
文件 490 2009-06-11 05:14 CSharp\bin\Debug\CSharp.vshost.exe.manifest
文件 99678 2010-08-12 09:30 CSharp\bitmap\1279286287_google_voice.ico
文件 99678 2010-08-12 09:30 CSharp\bitmap\delete.ico
文件 4336 2010-09-06 16:41 CSharp\bitmap\edit.png
文件 16588 2010-09-06 16:24 CSharp\bitmap\logo.png
文件 99678 2010-08-12 09:30 CSharp\bitmap\plus.ico
文件 4773 2010-09-07 11:58 CSharp\CSharp.csproj
文件 901 2010-09-02 10:58 CSharp\CSharp.sln
..A..H. 27136 2010-09-07 15:14 CSharp\CSharp.suo
文件 4770 2010-09-07 14:43 CSharp\FormSet.cs
文件 8739 2010-09-07 14:43 CSharp\FormSet.Designer.cs
文件 155634 2010-09-07 14:43 CSharp\FormSet.resx
文件 22847 2010-09-07 15:08 CSharp\MainForm.cs
文件 17344 2010-09-07 14:28 CSharp\MainForm.Designer.cs
文件 305933 2010-09-07 14:28 CSharp\MainForm.resx
文件 5120 2010-09-06 16:41 CSharp\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 490 2010-09-02 11:04 CSharp\Program.cs
文件 1344 2010-09-02 10:58 CSharp\Properties\AssemblyInfo.cs
文件 3828 2010-09-06 16:41 CSharp\Properties\Resources.Designer.cs
文件 6901 2010-09-06 16:41 CSharp\Properties\Resources.resx
文件 1091 2010-09-02 10:58 CSharp\Properties\Settings.Designer.cs
文件 249 2010-09-02 10:58 CSharp\Properties\Settings.settings
文件 2589 2010-09-07 11:55 CSharp\StartByWindows.cs
目录 0 2010-09-02 11:04 CSharp\obj\Debug\Refactor
目录 0 2010-09-06 16:41 CSharp\obj\Debug\TempPE
............此处省略10个文件信息
- 上一篇:基于Arcengine的地图打印小程序
- 下一篇:taskmgr.rar任务管理器
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- 无需共享打印机实现远程打印功能小
- 真正的破解版PDFView4NET
- 网页调用ActiveX控件获取串口数据
- Luence的与盘古分词的使用软件
- Emgu.CV 打开视频与人脸检测
- 麦克纳姆轮程序.rar
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- net微信支付
- lucene.net+盘古分词多条件全文检索并匹
- 闪电猫-电商下图助手5.0.zip
- FastReport.Net V2014.4.8 For .Net2.0
- NET Reflector 8.3破解版自带代码导出
评论
共有 条评论