摘要: 速度非常快,5W行40列,几秒完成。 VB :VSFlexGrid3.SaveGrid Path, flexFileExcel, flexXLSaveFixedCells Or flexXLSaveRaw 阅读全文
posted @ 2021-08-28 09:31 Cmale 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1.需要引用using System.Timers; 2.声明timer对象 3.注册Elapsed事件 参考代码如下: private void Form1_Load(object sender, EventArgs e) { System.Timers.Timer timer = new Sys 阅读全文
posted @ 2021-08-24 08:10 Cmale 阅读(199) 评论(0) 推荐(0) 编辑
摘要: //如通过object 使用button控件(利用object as button): public static void fun(object sender) { (sender as Button).BackColor = System.Drawing.Color.Green; } 阅读全文
posted @ 2021-08-22 23:11 Cmale 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 方法一、使用正则表达式 1、纯数字提取 string str = "提取123abc提取"; //我们抓取当前字符当中的123 string result = System.Text.RegularExpressions.Regex.Replace(str, @"[^0-9]+", ""); Con 阅读全文
posted @ 2021-08-11 08:33 Cmale 阅读(2856) 评论(0) 推荐(0) 编辑
摘要: private void skinDataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex != 0 || e.RowIndex < 0) return; if (sk 阅读全文
posted @ 2021-08-04 11:24 Cmale 阅读(232) 评论(0) 推荐(0) 编辑
摘要: private void dgvData_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (this.dgvData.CurrentCell.ColumnIndex == 阅读全文
posted @ 2021-08-03 18:50 Cmale 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 简化后代码: if(A.ToString() == "A" || A.ToString() == "B" || A.ToString() == "C") 简化后代码: if (new[] { "A", "B", "C" }.Contains(A.ToString())) 阅读全文
posted @ 2021-08-03 08:16 Cmale 阅读(939) 评论(0) 推荐(1) 编辑
摘要: public class IniInfo { //调用API函数 [DllImport("kernel32")] private static extern bool WritePrivateProfileString(string section, string key, string val, 阅读全文
posted @ 2021-07-30 16:11 Cmale 阅读(178) 评论(0) 推荐(0) 编辑
摘要: VS2019 技巧 大家好,今天分享几个我知道的实用 VS 技巧,而这些技巧我发现很多人都不知道。因为我经常在工作中遇到:我在同事电脑上解决问题,或在会议上演示代码示例时,使用了一些 VS “骚”操作,他们会好奇地问:你是怎么做到的?这给我的感觉,有时候你知道一些别人不知道的小技巧便可以让你显得更专 阅读全文
posted @ 2021-07-30 15:44 Cmale 阅读(1559) 评论(1) 推荐(3) 编辑
摘要: 1、判断文件夹是否存在 //spath:文件夹路径名 using System.IO; if (Directory.Exists(spath)) { } else { DirectoryInfo directoryInfo = new DirectoryInfo(spath); directoryI 阅读全文
posted @ 2021-07-30 15:14 Cmale 阅读(6037) 评论(0) 推荐(0) 编辑