摘要: /// <summary> /// 基于NPOI操作Excel /// </summary> public void ExportExcel() { string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Deskt 阅读全文
posted @ 2022-03-08 20:33 码农阿亮 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 一、引用BarcodeStandard.dll #region BarcodeStandard.dll /* * * 使用说明 需要通过NuGet进行安装BarcodeLib.dll,必不可少 */ string inputString; /// <summary> /// 获取所以打印机驱动名称 阅读全文
posted @ 2022-03-08 20:09 码农阿亮 阅读(1775) 评论(1) 推荐(0) 编辑
摘要: #region 读取电子秤数值 private SerialPort com; private void getWeightfromCOM() { string COM ="COM1"; com = new SerialPort(COM); //实例化SerialPort并设置COM口 com.Ba 阅读全文
posted @ 2022-03-08 19:35 码农阿亮 阅读(662) 评论(0) 推荐(0) 编辑
摘要: int xWidth = SystemInformation.PrimaryMonitorSize.Width;//获取显示器屏幕宽度 int yHeight = SystemInformation.PrimaryMonitorSize.Height;//高度 Button.Location = n 阅读全文
posted @ 2022-03-08 17:19 码农阿亮 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 一、读线圈状态 /// <summary> /// 读线圈状态测试 /// </summary> static void Test_0x01() { ushort startAddr = 0; ushort readLen = 10; var a = BitConverter.GetBytes(re 阅读全文
posted @ 2022-03-08 17:18 码农阿亮 阅读(864) 评论(0) 推荐(0) 编辑
摘要: 一、sql注入风险及解决方案 SQL注入是指在事先定义好的SQL语句中注入额外的SQL语句,从此来欺骗数据库服务器的行为。 示例:制作会员登录功能。 登录按钮代码如下: private void btLogin_Click(object sender, EventArgs e) { //1-定义连接 阅读全文
posted @ 2022-03-08 14:24 码农阿亮 阅读(81) 评论(0) 推荐(0) 编辑