摘要: // 创建一个SortedList对象SortedList mySL = new SortedList();mySL.Add("First", "Hello"); //获得指定索引处的键和值int myIndex = 3;Console.WriteLine("The key at index {0} 阅读全文
posted @ 2020-03-05 09:19 Bella.Li 阅读(306) 评论(2) 推荐(0) 编辑
摘要: 声明: List<T> mList = new List<T>(); 添加元素: mList.Add("John"); string[] temArr = { "Ha","Hunter", "Tom", "Lily", "Jay", "Jim", "Kuku", " "Locu" }; mList. 阅读全文
posted @ 2020-03-04 17:13 Bella.Li 阅读(1697) 评论(0) 推荐(0) 编辑
摘要: Dictionary提供快速的基于键值的元素查找。 结构是:Dictionary <[key] , [value] >,当你有很多元素的时候可以用它。 它包含在System.Collections.Generic名控件中。在使用前,你必须声明它的键类型和值类型。 using System; usin 阅读全文
posted @ 2020-03-04 16:50 Bella.Li 阅读(837) 评论(0) 推荐(0) 编辑
摘要: 1.图片链接列 DataGridViewImageColumn column = new DataGridViewImageColumn(); dataGridView1.Columns.Add(column); column.Name= "btnopenproject"; column.HeaderText = "操作"; column.Image = Properties.Reso... 阅读全文
posted @ 2019-04-03 14:44 Bella.Li 阅读(895) 评论(0) 推荐(0) 编辑
摘要: 1.定义委托 /// /// 设备状态发生改变委托定义 /// /// /// 设备状态事件改变参数 public delegate void DeviceStateChangedEventHandler(object sender, DeviceStateEventArgs pArg); 2.定义事件 /// /// 设备状态改变事... 阅读全文
posted @ 2019-02-25 11:33 Bella.Li 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #region【方法:解析数据线程】 private void DataParse() { int waittime = 0;//等待时间 bool isExit = false;//是否超时退出 byte[] headData = new byte[4];//命令头 ... 阅读全文
posted @ 2019-02-25 11:33 Bella.Li 阅读(3376) 评论(0) 推荐(0) 编辑
摘要: 同步: 1.定义委托 /// /// 通讯数据交互委托定义 /// /// /// 通讯交互数据事件改变参数 public delegate void CommunicateDataChangedEventHandler(object sender, CommunicateEventArgs pArg); 2.定义事件 //... 阅读全文
posted @ 2019-02-25 11:32 Bella.Li 阅读(217) 评论(0) 推荐(0) 编辑
摘要: #region【方法:导出excel事件响应方法】 private void btnExport_Click(object sender, EventArgs e) { string a = "D:" + "\\DataView.xls"; ExportExcels(a, dgDataView); ... 阅读全文
posted @ 2019-02-25 11:31 Bella.Li 阅读(668) 评论(0) 推荐(0) 编辑
摘要: 绑定datatable DataTable OrigDataDt; OrigDataDt = this.dgOrigianlView.DataSource as DataTable; OrigDataDt = new DataTable(); OrigDataDt.Columns.Add("Column1"); dgOrigianlView.DataSource = OrigD... 阅读全文
posted @ 2019-02-25 11:29 Bella.Li 阅读(902) 评论(0) 推荐(0) 编辑
摘要: private bool AutoConnectTimer() { int pBurante = 115200; string[] ports = SerialPort.GetPortNames(); foreach (string itemprot in ports) { if (ConnectC 阅读全文
posted @ 2019-01-19 14:21 Bella.Li 阅读(1890) 评论(0) 推荐(0) 编辑