摘要: 看到的一篇文本匹配程度程序,記一下 public static double Sim(string txt1, string txt2) { List<char> sl1 = txt1.ToCharArray().ToList(); List<char> sl2 = txt2.ToCharArray 阅读全文
posted @ 2020-04-20 13:19 刘中俊 阅读(1138) 评论(0) 推荐(0)
摘要: FileInfo fileInfo = new FileInfo(@"C:\test.txt"); FileSecurity fileSecurity = fileInfo.GetAccessControl(); IdentityReference identityReference = fileS 阅读全文
posted @ 2020-01-11 13:25 刘中俊 阅读(145) 评论(0) 推荐(0)
摘要: string file = Application.StartupPath + "\\config.ini"; public Form1() { InitializeComponent(); } [DllImport("kernel32")] private static extern bool W 阅读全文
posted @ 2019-12-02 13:20 刘中俊 阅读(127) 评论(0) 推荐(0)
摘要: 利用ZXing生成条码图像的主要代码段 using ZXing; using ZXing.Common; private void button1_Click(object sender, EventArgs e) { string SN = textBox1.Text; if (string.Is 阅读全文
posted @ 2019-12-02 10:07 刘中俊 阅读(435) 评论(0) 推荐(0)
摘要: 1 class Printer 2 { 3 [DllImport("kernel32.dll", CharSet = CharSet.Auto)] 4 private static extern SafeFileHandle CreateFile(string lpFileName, int dwD 阅读全文
posted @ 2019-12-02 09:58 刘中俊 阅读(301) 评论(0) 推荐(0)
摘要: 串口扫码枪读取主要代码段 1 public partial class Form1 : Form 2 { 3 public Form1() 4 { 5 InitializeComponent(); 6 } 7 SerialPort sp = new SerialPort("COM1", 115200 阅读全文
posted @ 2019-12-02 09:51 刘中俊 阅读(1203) 评论(0) 推荐(0)
摘要: List<Product> distinctProduct = allProduct .GroupBy(p => new {p.Id, p.Name} ) .Select(g => g.First()) .ToList(); 分组取第一条数据 阅读全文
posted @ 2019-11-28 13:05 刘中俊 阅读(234) 评论(0) 推荐(0)
摘要: var firstInterval; var secondInterval; function firstAlert(){ if(firstInterval) clearInterval(firstInterval);//这个是重点 //处理全部 ......... firstInterval = 阅读全文
posted @ 2019-11-28 11:55 刘中俊 阅读(1359) 评论(0) 推荐(0)
摘要: linq進行list分組匯總 1 var yield_day = (from item in yield 2 group item by new 3 { 4 item.DEFECTITEM, 5 item.CDAY 6 } 7 into g 8 select new 9 { 10 cday = g. 阅读全文
posted @ 2019-11-28 08:09 刘中俊 阅读(150) 评论(0) 推荐(0)
摘要: 获取分组后取某字段最大一条记录方法一:(效率最高)select * from test as awhere typeindex = (select max(b.typeindex)from test as bwhere a.type = b.type );方法二:(效率次之)selecta.* fr 阅读全文
posted @ 2019-11-27 17:32 刘中俊 阅读(6603) 评论(0) 推荐(0)