随笔分类 -  代码片段C#

程序开发中常用的代码片段
摘要://获取当前进程的完整路径,包含文件名(进程名)。string str = this.GetType().Assembly.Location;result: X:\xxx\xxx\xxx.exe (.exe文件所在的目录+.exe文件名)//获取新的 Process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。string str = System.Diagnostic... 阅读全文
posted @ 2017-06-21 15:19 谷仁儿 阅读(206) 评论(0) 推荐(0)
摘要:1、设置DataGridView 的属性 SelectionModeSelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;2、设置事件CellMouseDownprivate void dgvResult_CellMouseDown(object sender, DataGridViewCellMo... 阅读全文
posted @ 2017-06-20 13:12 谷仁儿 阅读(1481) 评论(0) 推荐(0)
摘要:1 public class Person : BaseDomain 2 { 3 long _id; 4 string firstName; 5 string secondName; 6 string comments; 7 8 public Person() 9 {} 10 11 public P 阅读全文
posted @ 2017-06-15 15:16 谷仁儿 阅读(3284) 评论(0) 推荐(0)
摘要:public object BatchProcess(List<ChannelProductDTO> data_list) { int pageSize = 50; var batchPackage= new List<ChannelProductDTO>(pageSize); List<Chann 阅读全文
posted @ 2017-05-18 12:54 谷仁儿 阅读(226) 评论(0) 推荐(0)
摘要:private void dataGridViewInventory_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { var dgv = sender as DataGridView; if(dgv != null) { ... 阅读全文
posted @ 2014-12-22 13:53 谷仁儿 阅读(249) 评论(0) 推荐(0)