摘要: public static class LogHelp { private static readonly ILog logger; private static readonly log4net.ILog LInfo = log4net.LogManager.GetLogger("LogInfo" 阅读全文
posted @ 2024-04-27 12:22 #青鸟爱吃鱼 阅读(11) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 将实体2的值动态赋值给实体1(名称一样的属性进行赋值) /// </summary> /// <param name="model1">实体1</param> /// <param name="model2">实体2</param> /// <returns>赋值 阅读全文
posted @ 2024-04-26 18:09 #青鸟爱吃鱼 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 一、封装基本连接、读写。读写 ReadHoldingRegisters ,当前有四种方案,现在只使用 ReadHoldingRegisters int 类型,需要其他方案自行新增。 public class ModbusClient { private TcpClient? tcpClient; p 阅读全文
posted @ 2024-04-26 18:04 #青鸟爱吃鱼 阅读(10) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main() { List<string> searchTerms = new List<string> { "term1", "term2", "term3" }; List<Company> companies = GetCompanies 阅读全文
posted @ 2024-03-11 15:50 #青鸟爱吃鱼 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1、其它用户登录MySQL2、#查看user表use mysql;select user,plugin from user;3、修改root密码格式# 修改其密码格式update user set plugin='mysql_native_password' where user='root'; # 阅读全文
posted @ 2023-09-18 16:26 #青鸟爱吃鱼 阅读(21) 评论(0) 推荐(0) 编辑
摘要: MQTT 服务可以自行学习,这里只是记录一下写的结果,粘贴即用。 首先引入包 MQTTnet ,注意 这个包这里的代码 是 4.0一下版本 我用的 3.1.2 版本的 4.以上是另外的写法,该内容中4 不支持我 直接下降版本到3.1.2 可以了。 如果你一定要用4.0以上的包,不用往下看了。 服务端 阅读全文
posted @ 2023-09-09 14:54 #青鸟爱吃鱼 阅读(569) 评论(0) 推荐(0) 编辑
摘要: using (var context = new EFDbContext()) { context.Database.Migrate(); } 阅读全文
posted @ 2023-08-25 14:44 #青鸟爱吃鱼 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 第一种 /// <summary> /// 获取网络状态 /// </summary> /// <param name="IP"></param> /// <returns></returns> public static bool CheckedIPSpeed(string IP) { //远程服 阅读全文
posted @ 2023-04-04 12:03 #青鸟爱吃鱼 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 递归方式1、创建一个树类 public class TreeNode { /// <summary> /// 子id /// </summary> public string Id { get; set; } /// <summary> /// 父id /// </summary> public s 阅读全文
posted @ 2023-03-23 10:31 #青鸟爱吃鱼 阅读(342) 评论(0) 推荐(1) 编辑
摘要: 1、安装 NLog.Web.AspNetCore 包 2、新增Configs文件夹,在Configs文件夹下新增nlog.config文件 nlog.config文件内容如下 <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://ww 阅读全文
posted @ 2023-03-15 09:21 #青鸟爱吃鱼 阅读(555) 评论(0) 推荐(0) 编辑