随笔分类 - .NET
.net core Razor 全球化和本地化 多语言
摘要:1.根目录建文件夹:Resource(存放资源文件) 和 ResourceClass(存放对应的空白类文件)2.添加资源文件到Resource文件夹中:Language.en-US.resx 和 Language.zh-CN.resx 打开资源文件,添加配置项,例如 中文资源文件 名称:Welcom
阅读全文
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
阅读全文
gzip字符串压缩,解压缩
摘要:xx using System.IO.Compression; public class StringCompress { /// <summary> /// 字符串压缩 /// </summary> /// <param name="strSource"></param> /// <returns
阅读全文
读写CSV文件
摘要:来源:https://www.cnblogs.com/lxhbky/p/12219080.html using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Ref
阅读全文
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.
阅读全文
.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
阅读全文
.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
阅读全文
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
阅读全文
Dapper用法
摘要:参考:https://www.cnblogs.com/atomy/p/12784361.htmlDapper存储过程:http://t.zoukankan.com/mengshi-p-4784640.html using Dapper; using System.Collections.Generi
阅读全文
.NET Core连接数据库,.Net Core连接Mysql数据库
摘要:DbContext:这里设置自定义连接字符串的写法过时了。参考连接MySql的写法。 using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using System; using WebApi.M
阅读全文
migration
摘要:EF命令Update-Database -Script -SourceMigration:"201901210832533_addTemporaryAttendanceDetail20190121.cs" -TargetMigration:"201902282225506_updatetableCo
阅读全文
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 -
阅读全文
.NET Core使用缓存
摘要:1.MemoryCache 服务器端缓存添加服务:services.AddMemoryCache();使用:注入IMemoryCache _memoryCache; var cityList = new List<City>(); if (!_memoryCache.TryGetValue("cit
阅读全文
蓝牙开发
摘要:代码: private void button1_Click(object sender, EventArgs e) { try { using (BluetoothClient client = new BluetoothClient()) { BluetoothDeviceInfo[] devi
阅读全文
Unable to load the specified metadata resource
摘要:本地运行都正常,就是发布到服务器上不行,查找了一些文章,都没解决我的问题,后来发现是路径不对和文件缺失。 原来的配置文件中是这样的: <add name="TRidentityEntities" connectionString="metadata=res://*/TRidentityModel.c
阅读全文
生成二维码、条形码、带logo的二维码
摘要:Nuget安装ZXing.Net,帮助类: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using ZXing; using ZXing.Com
阅读全文
Win10下windows mobile device center设备中心连接不上无法启动
摘要:微软Win10自动更细补丁后windows mobile设备中心就无法启动了 需要重新启动相关的服务并授予 本机登录用户 权限 1.点击屏幕左下角“开始”图标,点击“运行”,在弹出的输入框中输入“services.msc”按下回车键。 2.在弹出的界面中,找到“基于Windows Mobile 20
阅读全文
winform使用PrintDocument控件打印以及oledb驱动
摘要:代码,需要加入的控件:PrintDocument、PageSetupDialog、PrintDialog、PrintPreviewDialog、BackgroundWorker,控件的Document属性要指定为PrintDocument控件的id。导入Excel用的是12.0的驱动,需要下载:ht
阅读全文
下载网络资源-带下载进度
摘要:带进度 http://t.zoukankan.com/h82258652-p-10950580.html namespace AppUtils { public struct HttpDownloadProgress { public long BytesReceived { get; set; }
阅读全文
VSCode的使用
摘要:前后端分离的,先打开vs,打开你的项目,在项目根目录中找到.vs文件加,找到.vs\config\applicationhost.config,然后打开找到你项目的IIS Express配置,例如:<site name="TestPro.Web" id="2"> <application path=
阅读全文