![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
陌生人的L
这个作者很懒,什么都没留下…
展开
-
C#中dateTime日期时间差计算、判断
C#中日期时间差计算、判断判断某个时间是否在某一时间段内计算两个dateTime的时间差获取时间的小时部分判断某个时间是否在某一时间段内string _strWorkingDayAM = "08:00";//工作时间上午08:00string _strWorkingDayPM = "17:00";//工作时间下午17:00TimeSpan dspWorkingDayAM = DateTime.Parse(_strWorkingDayAM).TimeOfDay;TimeSpan dspWorking原创 2021-04-29 13:51:58 · 1431 阅读 · 0 评论 -
c#中导出DataGridView数据至Excel文件
添加引用修改引用属性中【嵌入互操作类型】为false新建classpublic class ExportDGVToExcel { /// <summary> /// DataGridView导出到Excel /// </summary> /// <param name="strCaption">Excel文件中的标题 /// <param name="myDGV">原创 2021-04-15 13:37:59 · 405 阅读 · 0 评论 -
c#中实现DataGridView点击右键显示菜单
1.添加ContextMenuStrip控件2.修改DataGridView的【ContextMenuStrip】属性3.修改DataGridView的【CellMouseUp】属性private void dataGridView1_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) {原创 2021-04-15 11:20:05 · 2782 阅读 · 0 评论