随笔分类 -  C#

康耐视 扫码枪
摘要:private bool ScanBarcodeDown() { Utility.OutputInfo(txtInfo, "下扫描枪发送读码命令"); if (Program.Config.ScanTimes <= 0) Program.Config.ScanTimes = 3; if (Progr 阅读全文

posted @ 2022-09-29 08:19 qq1151219115 阅读(606) 评论(0) 推荐(0) 编辑

Delegate Control BeginInvoke Invoke
摘要:Control.Invoke()方法所执行的委托方法跟创建UI元素的线程是一个线程,也就是主线程。Control.Invoke()虽然执行了委托方法,但是并没有创建新的线程,而且从实验结果出现的先后顺序可以得知,Invoke()是同步独占式的执行, Control的Invoke和BeginInvok 阅读全文

posted @ 2022-08-10 14:11 qq1151219115 阅读(20) 评论(0) 推荐(0) 编辑

获取 CPU 和内存占用
摘要:获取全局 CPU 和内存占用 要获取到全系统中的 CPU 占用率,获取全系统中内存占用,需要首先分别创建这两者的性能计数器: // 创建对 CPU 占用百分比的性能计数器。 var cpuCounter = new PerformanceCounter("Processor", "% Process 阅读全文

posted @ 2022-07-07 16:10 qq1151219115 阅读(402) 评论(0) 推荐(0) 编辑

C# Color Control
摘要:Control Color设置 lblLanguage.BackColor = Control.DefaultBackColor; lblLanguage.BackColor = Color.FromKnownColor(KnownColor.Control); 阅读全文

posted @ 2021-03-09 17:13 qq1151219115 阅读(338) 评论(0) 推荐(0) 编辑

ZedGraph X轴为时间
摘要:Random ran = new Random(); PointPairList list = new PointPairList(); LineItem myCurve; this.zedGraphControl1.GraphPane.Title.Text = "动态折线图"; this.zedG 阅读全文

posted @ 2020-04-12 12:45 qq1151219115 阅读(553) 评论(0) 推荐(0) 编辑

c#怎样让picturebox出现滚动条
摘要:将picturebox放到一个panel控件里面,然后设置panel控件的ArrowScroll属性为true,再设置picturebox的SizeMode属性为AutoSize 这样当图片长或宽超出panel就会自动出现滚动条 这里需要注意的是picturebox不能选择在父容器中停靠,否则没有滚 阅读全文

posted @ 2019-06-23 21:01 qq1151219115 阅读(238) 评论(0) 推荐(0) 编辑

C#动态加载dll,dll目录指定
摘要:<?xml version="1.0"?><configuration><startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> <runtime> <assemblyBinding 阅读全文

posted @ 2019-05-29 19:20 qq1151219115 阅读(240) 评论(0) 推荐(0) 编辑

RS485转RS232
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; namespace serial { public class ModBus { /// /// modbus状态 /... 阅读全文

posted @ 2019-05-28 14:12 qq1151219115 阅读(491) 评论(0) 推荐(0) 编辑

圆度
摘要: 阅读全文

posted @ 2019-04-28 09:48 qq1151219115 阅读(247) 评论(0) 推荐(0) 编辑

WinForm控件Dock属性设置会遮盖其他控件的解决
摘要:在被遮盖住的控件上,右击弹出快捷菜单,然后选择“置于顶层”。 阅读全文

posted @ 2019-03-22 14:16 qq1151219115 阅读(361) 评论(0) 推荐(1) 编辑

C# 扩展方法
摘要:https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/classes-and-structs/extension-methods 阅读全文

posted @ 2018-08-09 14:14 qq1151219115 阅读(113) 评论(0) 推荐(0) 编辑

C# Collection 排序
摘要:Collection<int> aa = new Collection<int>(); aa.Add(1); aa.Add(2); aa.Add(3); aa.Add(1); int[] arr = new int[aa.Count]; aa.CopyTo(arr, 0); int[] bb = a 阅读全文

posted @ 2018-08-09 14:06 qq1151219115 阅读(393) 评论(0) 推荐(0) 编辑

ListView添加图片文字项
摘要:1)listview 控件 结合 imagelist 控件 实现类似效果. 2)添加 imagelist 控件 images 属性,点击后面的... 添加相应图片. 3)点listview,查看其属性,LargeImageList 和 SmallImageList 分别是设置大小视图的图片集合的,你 阅读全文

posted @ 2018-07-13 16:54 qq1151219115 阅读(259) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示