随笔分类 -  .NET及相关技术

摘要:安装包 安装nuget包NLog.Web.AspNetCore和Microsoft.Extensions.Logging 配置文件NLog.config <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-proj 阅读全文
posted @ 2021-09-02 08:47 酷学大叔 阅读(243) 评论(0) 推荐(0)
摘要:转载:http://www.zzvips.com/article/78612.html 阅读全文
posted @ 2020-10-21 09:30 酷学大叔 阅读(296) 评论(0) 推荐(0)
摘要:AbsoluteExpirationRelativeToNow:相对与现在的绝对过期时间 SlidingExpiration:可调过期时间(或滑动时间) await _memoryCache.GetOrCreateAsync<List<Msg>>("key", async entry =>{ ent 阅读全文
posted @ 2020-07-15 15:07 酷学大叔 阅读(1430) 评论(0) 推荐(0)
摘要:github地址:https://github.com/fxsjy/jieba 阅读全文
posted @ 2020-07-03 11:18 酷学大叔 阅读(136) 评论(0) 推荐(0)
摘要:转载:https://www.cnblogs.com/willick/p/csharp-enum-superior-tactics.html 阅读全文
posted @ 2020-06-09 10:38 酷学大叔 阅读(203) 评论(0) 推荐(0)
摘要:转载:https://www.jianshu.com/p/b6b86476c106 阅读全文
posted @ 2020-06-04 10:36 酷学大叔 阅读(144) 评论(0) 推荐(0)
摘要:今天在学习winform项目时,看到同时是这样解决text文本框变换值的: winform界面是这样的 于是我在想,为什么不直接进行赋值来进行变换,而通过替换局部字符串来变换呢?两者之间有什么区别?到底哪一种的性能会好点?于是带着种种疑问,设计了如下实验: using System; using S 阅读全文
posted @ 2020-06-01 17:52 酷学大叔 阅读(541) 评论(0) 推荐(0)
摘要:Hashtable.Synchronized(new HashTable())将HashTable封装成一个线程安全的SyncHashTable。 但该方法在枚举整个集合时本质上不是一个线程安全的过程,即使某个集合已经同步,其他线程仍可以修改该集合,这会导致枚举数引发异常。 若要确保枚举过程中的线程 阅读全文
posted @ 2020-04-29 15:51 酷学大叔 阅读(1012) 评论(0) 推荐(0)
摘要:前言 System.Timers.Timer组件是基于服务器的计时器,它能够指定在应用程序中引发Elapsed事件周期性间隔,以处理相应事件。 使用示例: 运行结果展示: System.Timers.Timer属性、方法解读: 1)默认100毫秒触发一次Elapsed事件,可通过其属性Interva 阅读全文
posted @ 2020-04-29 13:33 酷学大叔 阅读(1596) 评论(0) 推荐(0)
摘要:1、ThreadPool与Task? 线程池的优点:① 降低资源消耗。通过重复利用已创建的线程降低线程创建和销毁造成的消耗。 ② 提高响应速度。当任务到达时,任务可以不需要等到线程创建就能立即执行。 ③ 提高线程的可管理性。线程是稀缺资源,如果无限制的创建,不仅会消耗系统资源,还会降低系统的稳定性, 阅读全文
posted @ 2020-04-15 10:45 酷学大叔 阅读(343) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/asd14828/p/12579605.html 阅读全文
posted @ 2020-04-01 14:33 酷学大叔 阅读(388) 评论(0) 推荐(0)
摘要:dotnet [解决方案bin文件下的dll文件] --urls="http://*:8888" --port=8888 阅读全文
posted @ 2020-03-23 15:04 酷学大叔 阅读(2827) 评论(0) 推荐(0)
摘要:本示例使用的是.net core2.2版本,微软提供了访问第三方服务的扩展,只需要在Startup.cs中添加。 紧接着就是通过DI直接使用。示例如下: using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Ge 阅读全文
posted @ 2020-03-12 09:57 酷学大叔 阅读(2030) 评论(0) 推荐(0)
摘要:一 前言 实战踩坑系列,调用第三方Oracle存储,各种血泪史,现记录如下。 二 入坑 首先,调用Oracle需要安装客户端驱动才行,但是在程序开发中下载客户端驱动是一个不明智的选择。于是,不管是微软,还是oracle,都提供了方便我们程序开发的插件(dll/nuget),如System.Data. 阅读全文
posted @ 2020-03-05 16:26 酷学大叔 阅读(1896) 评论(0) 推荐(2)
摘要:https://www.cnblogs.com/viter/p/12116640.html 阅读全文
posted @ 2020-01-19 15:44 酷学大叔 阅读(1175) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/6fa0a8be8758 https://www.cnblogs.com/yyfh/p/11787434.html https://www.telerik.com/blogs/health checks in aspnet core 阅读全文
posted @ 2020-01-19 15:43 酷学大叔 阅读(199) 评论(0) 推荐(0)
摘要:首先了解下mvc中html链接方式: ① <a href="/home/details/@Id">查看</a> ② <a href="@Url.Action("details", "home", new { id = Id })">查看</a> ③ @Html.ActionLink("查看", "d 阅读全文
posted @ 2020-01-17 10:02 酷学大叔 阅读(237) 评论(0) 推荐(0)
摘要:如何让验证信息友好的显示? 自定义输入验证:实现IValidatableObject 自定义Attribute属性: 【注】第三方提供的FluentValidation功能比较强大,做到了validate与model分离,能够制定一些比较复杂的规则,上手简单,推荐使用。 阅读全文
posted @ 2020-01-15 08:38 酷学大叔 阅读(1546) 评论(0) 推荐(0)
摘要:环境描述:macOS 、vscode 、netcore3.0 迁移工具:Microsoft.EntityFrameworkCore.Tools 遇到的问题: Could not execute because the specified command or file was not found. 阅读全文
posted @ 2019-12-09 08:55 酷学大叔 阅读(706) 评论(0) 推荐(0)
摘要:C#6.0推出了内插字符串 结果展示: 内插表达式字段宽度和对齐方式: 结果展示:(+/-代表右对齐、左对齐,数字表示显示宽度) 【补充】String.Format("|{0,-25}|{1,10}","hammer,cross pein","5"); 阅读全文
posted @ 2019-12-06 10:46 酷学大叔 阅读(695) 评论(0) 推荐(0)