上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: 在C#中父类可以直接转子类,叫做协变 子类转父类需要添加强制转换,叫做逆变 public class Person { } public class Student:Person { } var p = new Person(); p = new Student(); //协变是父类转子类,可以直接 阅读全文
posted @ 2024-02-23 09:49 孤沉 阅读(44) 评论(0) 推荐(0)
摘要: 1、自定义配置 <?xml version="1.0" encoding="utf-8" ?> <configuration> <log4net> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAp 阅读全文
posted @ 2024-02-21 20:37 孤沉 阅读(31) 评论(0) 推荐(0)
摘要: 1、我们在做工控项目的时候通常设置配方的上下限 这个时候要求OK数在上下限范围之内,否则NG 首先我们绑定一个简单的List用来展示数据,我这里用学生Age来展示 <ListView ItemsSource="{Binding DataList}" Margin="20"> <ListView.Vi 阅读全文
posted @ 2024-02-02 22:28 孤沉 阅读(99) 评论(0) 推荐(0)
摘要: /// <summary> /// PLC处理器 /// </summary> public interface IPlcHandler { void Request(IPlcContext context); } /// <summary> /// PLC的数据上下文 /// </summary> 阅读全文
posted @ 2024-01-23 20:32 孤沉 阅读(23) 评论(0) 推荐(0)
摘要: 上位机使用Hsl框架连接PLC 顺便讲下策略模式 话不多说,直接上代码 public interface IPlcHost { bool ConnectionPlc(string path); } public class FastPlcHost : IPlcHost { private Sieme 阅读全文
posted @ 2024-01-20 13:28 孤沉 阅读(68) 评论(0) 推荐(0)
摘要: 1、现在我介绍一个类库NewLife,非常流批 先介绍它读取json吧 WPF前台随便绑定一下 <TextBlock Text="{Binding ArticleText}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSi 阅读全文
posted @ 2024-01-17 00:07 孤沉 阅读(47) 评论(0) 推荐(0)
摘要: 1、最简单的使用 public class DatabaseService { private static readonly Lazy<SqlSugarClient> _db = new Lazy<SqlSugarClient>(() => { var db = new SqlSugarClien 阅读全文
posted @ 2024-01-15 02:49 孤沉 阅读(608) 评论(2) 推荐(0)
摘要: 1、我这里使用的是HslCommunication 假如传递的是word类型,PLC以16进制封装数组,它有预留,我扩充 PLC博图上是 word[5] 上位机接收 ushort[] Data1=new ushort[5] Data1[0] = byteTransform.TransUInt16(r 阅读全文
posted @ 2023-12-22 22:45 孤沉 阅读(181) 评论(0) 推荐(0)
摘要: 1、MySql服务器共享问题 对于在车间工作者,如果远程Mysql,我们这里假定网线连接 GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 允许对应的主机 阅读全文
posted @ 2023-12-17 09:21 孤沉 阅读(28) 评论(0) 推荐(0)
摘要: 一、推送项目到远程 1、先初始化 git init 2、查看关联的仓库 git remote -v 3、关联远程仓库 git remote add origin https://github.com/guchen66/xxx.git 4、查看关联仓库 git remote -v 5、error:re 阅读全文
posted @ 2023-12-17 08:35 孤沉 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页