随笔分类 -  .NET

.net8连接MySQL、连接MySQL显示SSL Authentication Error错误处理
摘要:参考.net6连接mysql:https://www.cnblogs.com/xsj1989/p/15379350.html其中.net8版本的不能安装:MySql.EntityFrameworkCore这个包,需要安装Pomelo.EntityFrameworkCore.MySql,而且版本号必须 阅读全文
posted @ 2023-12-29 17:15 邢帅杰 阅读(551) 评论(0) 推荐(0)
VS运行网站报错Failed to register URL "http://localhost:5718/" for site
摘要:很多都说是端口被占用,的确有可能,但大部分不是这样管理员运行cmd(命令提示符),执行命令: net stop winnatnet start winnat 阅读全文
posted @ 2023-10-11 10:43 邢帅杰 阅读(396) 评论(0) 推荐(0)
DES加密解密
摘要:来源:https://blog.csdn.net/Zhangchen9091/article/details/46278463https://blog.51cto.com/cbcw/6289416 using System; using System.IO; using System.Securit 阅读全文
posted @ 2023-10-09 15:46 邢帅杰 阅读(57) 评论(0) 推荐(0)
.net core websocket
摘要:来源:https://blog.csdn.net/i2blue/article/details/125288034Program.cs #region WebSockets // https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/w 阅读全文
posted @ 2023-04-12 10:45 邢帅杰 阅读(344) 评论(0) 推荐(1)
.net core Razor 全球化和本地化 多语言
摘要:1.根目录建文件夹:Resource(存放资源文件) 和 ResourceClass(存放对应的空白类文件)2.添加资源文件到Resource文件夹中:Language.en-US.resx 和 Language.zh-CN.resx 打开资源文件,添加配置项,例如 中文资源文件 名称:Welcom 阅读全文
posted @ 2023-03-29 15:05 邢帅杰 阅读(252) 评论(0) 推荐(0)
c#启动EXE文件
摘要:xxx来源:http://t.zoukankan.com/TBW-Superhero-p-5570650.htmlhttp://t.zoukankan.com/flywing-p-10570063.html #region 安装程序 try { //D:\Demos\ConsoleApp1\Cons 阅读全文
posted @ 2022-12-30 10:08 邢帅杰 阅读(277) 评论(0) 推荐(0)
gzip字符串压缩,解压缩
摘要:xx using System.IO.Compression; public class StringCompress { /// <summary> /// 字符串压缩 /// </summary> /// <param name="strSource"></param> /// <returns 阅读全文
posted @ 2022-12-10 12:31 邢帅杰
读写CSV文件
摘要:来源:https://www.cnblogs.com/lxhbky/p/12219080.html using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Ref 阅读全文
posted @ 2022-09-29 15:47 邢帅杰 阅读(58) 评论(0) 推荐(0)
VS2022/VS2019安装WinForm打包程序,Microsoft Visual Studio Installer Projects 2022下载(网盘下载),Installer Projects 2019下载,图标库,VS2022打包程序添加步骤,打包程序.Net Framework版本选择
摘要:问题:使用VS2022创建WinForm程序,完了需要打包成安装程序,这时候我去下载Microsoft Visual Studio Installer Projects 2022插件,速度超级慢,恶心人。总算是下载下来了,我存到我的网盘上面了,下载链接,速度快点:https://pan.baidu. 阅读全文
posted @ 2022-09-29 10:33 邢帅杰 阅读(1658) 评论(1) 推荐(1)
.net使用PLinq并行查询提升查询效率,List.AsParallel(),ForAll()替换Foreach
摘要:参考:https://docs.microsoft.com/zh-cn/dotnet/standard/parallel-programming/introduction-to-plinq var source = Enumerable.Range(1, 10000); // Opt in to P 阅读全文
posted @ 2022-08-05 16:21 邢帅杰 阅读(273) 评论(0) 推荐(0)
.NET CORE全局异常处理(自定义过滤器 ExceptionFilterAttribute、自定义中间件)配合log4net写日志
摘要:1、自定义中间件处理异常(推荐) 参考:https://www.csframework.com/archive/1/arc-1-20211230-4180.htm using System.Net; using System.Text.Json; using ExceptionHandling.Mo 阅读全文
posted @ 2022-07-25 21:26 邢帅杰 阅读(694) 评论(0) 推荐(0)
RabbitMQ、ErLang下载、RabbitMQ下载
摘要:最新资源2022-07-01RabbitMQ下载链接:https://pan.baidu.com/s/1VBbH40EvY46jNRdiKYhFuw 提取码:bcuq 版本 rabbitmq-server-3.10.5.exeErLang下载链接:https://pan.baidu.com/s/14 阅读全文
posted @ 2022-06-30 14:01 邢帅杰 阅读(747) 评论(0) 推荐(0)
Dapper用法
摘要:参考:https://www.cnblogs.com/atomy/p/12784361.htmlDapper存储过程:http://t.zoukankan.com/mengshi-p-4784640.html using Dapper; using System.Collections.Generi 阅读全文
posted @ 2022-06-23 13:22 邢帅杰 阅读(91) 评论(0) 推荐(0)
.NET Core连接数据库,.Net Core连接Mysql数据库
摘要:DbContext:这里设置自定义连接字符串的写法过时了。参考连接MySql的写法。 using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using System; using WebApi.M 阅读全文
posted @ 2021-10-08 13:29 邢帅杰 阅读(647) 评论(0) 推荐(0)
migration
摘要:EF命令Update-Database -Script -SourceMigration:"201901210832533_addTemporaryAttendanceDetail20190121.cs" -TargetMigration:"201902282225506_updatetableCo 阅读全文
posted @ 2021-06-10 16:51 邢帅杰 阅读(362) 评论(0) 推荐(0)
Fody is only supported on MSBuild 16 and above
摘要:.net framework版本是4.6.1,所以不能安装高版本的fody,降级fody解决:可以在VS的程序包管理器控制台中输入Install-Package Fody -Version 4.2.1来安装4.2.1版本的Fody,然后输入Install-Package Costura.Fody - 阅读全文
posted @ 2021-01-07 16:57 邢帅杰 阅读(704) 评论(0) 推荐(0)
.NET Core使用缓存
摘要:1.MemoryCache 服务器端缓存添加服务:services.AddMemoryCache();使用:注入IMemoryCache _memoryCache; var cityList = new List<City>(); if (!_memoryCache.TryGetValue("cit 阅读全文
posted @ 2020-10-22 10:06 邢帅杰 阅读(311) 评论(0) 推荐(0)
蓝牙开发
摘要:代码: private void button1_Click(object sender, EventArgs e) { try { using (BluetoothClient client = new BluetoothClient()) { BluetoothDeviceInfo[] devi 阅读全文
posted @ 2020-09-07 17:01 邢帅杰 阅读(242) 评论(0) 推荐(0)
Unable to load the specified metadata resource
摘要:本地运行都正常,就是发布到服务器上不行,查找了一些文章,都没解决我的问题,后来发现是路径不对和文件缺失。 原来的配置文件中是这样的: <add name="TRidentityEntities" connectionString="metadata=res://*/TRidentityModel.c 阅读全文
posted @ 2019-07-02 14:30 邢帅杰 阅读(1480) 评论(0) 推荐(0)
生成二维码、条形码、带logo的二维码
摘要:Nuget安装ZXing.Net,帮助类: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using ZXing; using ZXing.Com 阅读全文
posted @ 2019-03-18 10:03 邢帅杰 阅读(580) 评论(0) 推荐(0)