hopeless

导航

2009年6月4日

c#中删除ArrayList中的重复数据

摘要: ArrayList arrayList = new ArrayList(); arrayList.Add("1"); arrayList.Add("1"); arrayList.Add("2"); arrayList.Add("2"); arrayList.Add("3"); arrayList.Add("3"); arrayList.Add("4"); arrayList.Add("5"); ... 阅读全文

posted @ 2009-06-04 10:09 hopeless 阅读(1184) 评论(1) 推荐(0) 编辑

2009年5月18日

关于TreeView控件父子节点Checked属性完美控制的实现类(C#) 的改进

摘要: 主要功能:当在TreeView控件中选中父节点时,子节点全部选中;并能根据各子节点的选中状态自动改变父节点的选中状态。使用方法:直接在TreeView控件的AfterCheck(object sender, TreeViewEventArgs e)事件中调用TreeViewCheck类的CheckControl(TreeViewEventArgs e)方法并传入参数e即可。类代码: 程序代码usi... 阅读全文

posted @ 2009-05-18 16:37 hopeless 阅读(668) 评论(1) 推荐(1) 编辑

2009年1月13日

在C#中画同心圆

摘要: Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->//在一个picture控件中画同心圆 Graphics graphics = pictureBox2.CreateGraphics(); ... 阅读全文

posted @ 2009-01-13 10:12 hopeless 阅读(1250) 评论(0) 推荐(0) 编辑

2008年9月1日

变量声明体会

摘要: 变量声明时要给变量赋初值,如果不给变量赋初值,默认值为null,为程序处理增加麻烦,如果大家有好的建议请提出来 阅读全文

posted @ 2008-09-01 10:28 hopeless 阅读(262) 评论(0) 推荐(0) 编辑

2008年8月27日

在c#中为水晶报表中的文本框控件赋值

摘要: 声明报表变量 public CrystalReportRun oRpt = new CrystalReportRun(); //声明文本框变量 CrystalDecisions.CrystalReports.Engine.TextObject 文本变量名; 文本变量名 = (CrystalDecisions.CrystalReports.Engine.TextObject)oRpt.Repor... 阅读全文

posted @ 2008-08-27 16:20 hopeless 阅读(974) 评论(0) 推荐(0) 编辑

2008年8月21日

在c#中利用存储过程实现数据库备份恢复

摘要: /// /// 数据库的备份 /// /// 服务器名称 /// 用户名 /// 用户密码 /// 数据库名称 /// 数据库文件 /// public bool BackUPDB(string ServerName, string UserName... 阅读全文

posted @ 2008-08-21 18:23 hopeless 阅读(1664) 评论(2) 推荐(0) 编辑

2008年7月31日

在c#中利用SQLDMO备份恢复数据库

摘要: Code 里面注意: 1:在项目工程中引用sqldmo 2: 无论是备份路径还是恢复路径,都要使用"[]”把路径括起来,要不路径有空格就会报错 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1 private void butt... 阅读全文

posted @ 2008-07-31 16:35 hopeless 阅读(236) 评论(0) 推荐(0) 编辑

2008年7月7日

在程序运行时更改config文件内容

摘要: /// /// 更新app.config的函数 /// /// config文件名称 /// 键 /// 键值 public static void UpdateConfig(string strFile, string key, string Xvalue) { ... 阅读全文

posted @ 2008-07-07 17:17 hopeless 阅读(224) 评论(0) 推荐(0) 编辑

在datagridview控件总增加合计

摘要: //记录集与DataGridView绑定 dataGridViewList.DataSource = ds.Tables[0]; //增加合计行 DataRow dr = ds.Tables[0].NewRow(); dr["bianhao"] = "合计:"; object objSum = ds.Tables[0].Compute("Sum(chongzhijine)", null); ... 阅读全文

posted @ 2008-07-07 17:14 hopeless 阅读(454) 评论(0) 推荐(0) 编辑