随笔分类 -  .NET

摘要:安装个MQTTnet 3.1.1,然后开干 不废话了,直接贴代码 public class Program { public static IMqttServer mqttServer; static void Main(string[] args) { StartServer(); while ( 阅读全文
posted @ 2022-07-27 16:47 .jx 阅读(712) 评论(0) 推荐(0) 编辑
摘要:1、创建一个控制台程序 略 2、nuget 安装如下包 3、代码 var config = new ConfigurationBuilder() .AddInMemoryCollection() //缓存 .SetBasePath(Directory.GetCurrentDirectory()) . 阅读全文
posted @ 2022-07-27 16:32 .jx 阅读(680) 评论(0) 推荐(0) 编辑
摘要:执行的方法都在DBContext里 比如写一个方法 ,继承 DBContext public class LogDBContext : DbContext { public DbSet<LogModel> LogModels { get; set; } } 然后下面是使用方法 public asyn 阅读全文
posted @ 2022-07-25 19:12 .jx 阅读(718) 评论(0) 推荐(1) 编辑
摘要:先在配置文件 appsetting.json 添加一个Key,随便什么都行,自己定 "CorsUrls": "http://localhost:8080" 然后在 Program.cs 里,以前是Startup.cs注入服务 string CorsUrls = configuration["Cors 阅读全文
posted @ 2022-06-02 17:52 .jx 阅读(574) 评论(0) 推荐(0) 编辑

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