.netcore 模块积累

最全的 demo

https://github.com/XiaoFaye/netcore-samples

https://files.cnblogs.com/files/kellynic/practical-aspnetcore-master.zip

--------------------------------

.net core markdown 转换

"CommonMark.Net" : "0.13.4"

--------------------------------

.net core 国际区域化,做多国语言版有用

"Microsoft.AspNetCore.Localization": "1.1.0",
"Microsoft.Extensions.Localization" : "1.1.0"

--------------------------------

.net core 退出程序时有用,IApplicationLifetime

public void Configure(IApplicationBuilder app, IApplicationLifetime lifetime)
{
lifetime.ApplicationStarted.Register(() => System.Console.WriteLine("===== Server is starting"));
lifetime.ApplicationStopping.Register(() => System.Console.WriteLine("===== Server is stopping"));
lifetime.ApplicationStopped.Register(() => System.Console.WriteLine("===== Server has stopped"));

--------------------------------

.net core 获取平台环境信息

"Microsoft.Extensions.PlatformAbstractions" : "1.1.0-*"

--------------------------------

.net core 循环 form 表单值

var form = await context.Request.ReadFormAsync();

for (var k in form.Keys)

--------------------------------

.net core 获取上传文件

var form = await context.Request.ReadFormAsync();

for (var f in form.Files)

--------------------------------

.net core 读取 xml 配置

"Microsoft.Extensions.Configuration.Xml" : "1.1.0",

--------------------------------

.net core 读取 ini 配置

"Microsoft.Extensions.Configuration.INI" : "1.1.0",

--------------------------------

.net core 重定向,正则

"Microsoft.AspNetCore.Rewrite" : "1.0.0-*",

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory logger)
{
var options = new RewriteOptions()
.AddRedirect("([/_0-9a-z-]+)+(.*)$", "/?path=$1&ext=$2"); //redirect any path that ends with .html

app.UseRewriter(options);

--------------------------------

.net core 日志Serilog

"Serilog.Extensions.Logging": "1.0.0-rc2-10110",
"Serilog.Sinks.File": "2.0.0-rc-706"

--------------------------------

.net core mvc测试

MyTested.AspNetCore.Mvc

--------------------------------

.netcore razor模板引擎渲染
https://github.com/toddams/RazorLight

--------------------------------

.net core 图片,验证码

https://github.com/JimBobSquarePants/ImageSharp

https://github.com/dlemstra/Magick.NET

--------------------------------

.net core 二维码,linux环境下需先安装 apt-get install libgdiplus

Gma.QrCodeNet.Encoding

posted @   nicye  阅读(872)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示