摘要: 在一些项目中,有一些动态数据保存的需求,保存为CSV。 解决方法如下: 引用: using System;using System.Data;using System.Collections;using System.Collections.Generic;using System.Linq;usi 阅读全文
posted @ 2023-03-15 09:41 chenaran 阅读(57) 评论(0) 推荐(0) 编辑
摘要: (一)创建服务QuarzServiceusing System.ServiceProcess;using System.Text;using Quartz;using Quartz.Impl;using WinNet.Log;namespace QuarzService{ public par... 阅读全文
posted @ 2015-03-31 11:44 chenaran 阅读(449) 评论(0) 推荐(0) 编辑
摘要: using DevExpress.XtraEditors;using DevExpress.XtraEditors.Controls;using DevExpress.XtraGrid;using DevExpress.XtraGrid.Views.Base;private void gridControl1_Leave(object sender, EventArgs e) {DevExpress.XtraGrid.Views.Base.ColumnView view = gridControl1.FocusedView as ColumnView; view.CloseEditor(); 阅读全文
posted @ 2013-04-22 11:24 chenaran 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 关于 C# System.Windows.Forms.NumericUpDown 控件,如何禁用鼠标中间键?方法如下:声明一个事件:Num_DiscountAmount.MouseWheel +=new MouseEventHandler(Num_DiscountAmount_MouseWheel);编写一个事件private void Num_DiscountAmount_MouseWheel(object sender, MouseEventArgs e) { HandledMouseEventArgs h = e as HandledMouseEve... 阅读全文
posted @ 2013-03-06 12:18 chenaran 阅读(671) 评论(0) 推荐(0) 编辑
摘要: 在使用.NET创建的程序或组件时,元数据(metadata)和代码(code)都存储于“自成一体”的单元中,这个单元称为装配件。我们可以在程序运行期间访问这些信息。在System.Reflection中有这样一个class————Assembly,我们可以通过它来加载一个装配件。方法如下:Assembly assm=Assembly.LoadFrom(fileName);其中filename是要加载的装配件的文件名称(带路径)。接下来,我们就可以通过使用System.Reflection内提供的Info classes来获取装配件中的信息了。首先让我们看一下这些Info classes:M.. 阅读全文
posted @ 2013-02-22 17:37 chenaran 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 转载于:http://ipmingsee.blog.163.com/blog/static/7126372012013111923547/或:http://support.microsoft.com/kb/323490/zh-cn 阅读全文
posted @ 2013-02-22 16:23 chenaran 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 转载于:http://msdn.microsoft.com/en-us/library/y6dc64f2(v=vs.80).aspx 阅读全文
posted @ 2013-02-22 16:01 chenaran 阅读(249) 评论(0) 推荐(1) 编辑
摘要: 有时候写一些操作数据库是,要执行多条Sql语句,不得不用事务处理。用程式方法: public static bool ExecuteSqlTransaction(ArrayList list) { bool yes = false; using (SqlConnection con = new SqlConnection(_ConnectString)) { con.Open(); using (SqlTransaction trans = con.Beg... 阅读全文
posted @ 2013-02-19 17:20 chenaran 阅读(702) 评论(0) 推荐(0) 编辑
摘要: private DataTable RowToCol(DataTable Dt_newData) { DataTable Dt_Return = new DataTable(); DataColumn col = new DataColumn(); col.ColumnName = "Title"; col.Caption = "Title"; Dt_Return.Columns.Add(col); List<string> colName = n... 阅读全文
posted @ 2012-09-14 08:51 chenaran 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 在combobox 同时显示图片,文字,如图:引用:using System.Windows.Media.Imaging;功能函数如下: /// <summary> /// combobox 下拉同時顯示 圖片文字 /// </summary> /// <param name="_cmbImg"></param> /// <param name="ImgPath"></param> /// <param name="Title"></param& 阅读全文
posted @ 2011-07-27 16:22 chenaran 阅读(433) 评论(2) 推荐(1) 编辑