随笔分类 -  .netcore

摘要:原文链接: https://www.runoob.com/http/mime-types.html MIME 类型 MIME (Multipurpose Internet Mail Extensions) 是描述消息内容类型的标准,用来表示文档、文件或字节流的性质和格式。 MIME 消息能包含文本、 阅读全文
posted @ 2024-07-02 11:30 yinghualeihenmei 阅读(116) 评论(0) 推荐(0)
摘要:原文链接:https://www.jb51.net/article/280334.htm 配置环境:开发环境、测试环境、生产环境需要进行不同配置 运行环境:ASP.NET Core 会从环境变量中读取名字为 ASPNETCORE_ENVIRONMENT 的值 推荐值: Development —— 阅读全文
posted @ 2024-07-02 11:19 yinghualeihenmei 阅读(144) 评论(0) 推荐(0)
摘要:原文链接:https://www.yisu.com/jc/691937.html 我们使用VS创建一个ASP.NET Core WebAPI项目,由于是使用HttpClient,首先在ConfigureServices方法中进行注入。 public void ConfigureServices(IS 阅读全文
posted @ 2024-07-02 10:04 yinghualeihenmei 阅读(163) 评论(0) 推荐(1)
摘要:原文链接:https://zhuanlan.zhihu.com/p/637395503 1,在ConfigureServices方法里加入services.AddSession() 配置 public void ConfigureServices(IServiceCollection service 阅读全文
posted @ 2024-07-02 09:48 yinghualeihenmei 阅读(194) 评论(0) 推荐(0)
摘要:参考资料:https://www.cnblogs.com/RainFate/p/16920591.html AI生成: 在.NET Core中,Services.AddDistributedMemoryCache()方法用于注册分布式内存缓存。这是一个内存中的缓存解决方案,适用于需要在多个服务器或服 阅读全文
posted @ 2024-07-01 18:16 yinghualeihenmei 阅读(304) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/hsiang/p/17368101.html 什么是HttpContext? 在B/S模式开发的程序中,客户端是浏览器,服务器端Web服务程序,HttpContext是连接客户端和服务器端程序的桥梁,交代了当前请求的环境信息,它封装了请求[R 阅读全文
posted @ 2024-07-01 18:00 yinghualeihenmei 阅读(121) 评论(0) 推荐(0)
摘要:答案为ai生成 ForwardedHeadersOptions 是 ASP.NET Core 中用于配置转发头部的一个类。当应用程序位于负载均衡器(https://blog.csdn.net/cyl101816/article/details/135195729)、反向代理服务器(https://c 阅读全文
posted @ 2024-07-01 16:53 yinghualeihenmei 阅读(75) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/weixin_52026996/article/details/135929070 简介:Kestrel 是一个跨平台的、开源的、轻量级的 HTTP 服务器,它是 ASP.NET Core 的默认 Web 服务器。Kestrel 是跨平台的,因此 阅读全文
posted @ 2024-07-01 16:23 yinghualeihenmei 阅读(264) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/riddly/p/17467420.html 请求大小一般在文件上传的时候会用到,当然也防止传过来的参数过大情况。 一、设置请求体的最大值 (在HTTP请求中,如果需要将数据从客户端(如,浏览器)发送给API,则我们会将其作为“请求体(req 阅读全文
posted @ 2024-07-01 13:50 yinghualeihenmei 阅读(596) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/dabusidede/article/details/124858045 内存缓存包: Microsoft.Extensions.Caching.Memory 1.注册内存缓存 services.AddMemoryCache(); 2.基本使用示 阅读全文
posted @ 2024-07-01 11:56 yinghualeihenmei 阅读(52) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/xiongze520/p/14500156.html 今天在项目上遇到一个坑, 在.Net Core中通过ajax向mvc的controller传递对象时,控制器(controller)的方法一直没有进去,百思不得其解, 后面把传递的参数打印 阅读全文
posted @ 2024-07-01 11:14 yinghualeihenmei 阅读(81) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/zls365365/article/details/124162096 前言 以前.NetCore是不内置JSON库的,所以大家都用Newtonsoft的JSON库,而且也确实挺好用的,不过既然官方出了标准库,那更方便更值得我们多用用,至少不用每 阅读全文
posted @ 2024-07-01 10:35 yinghualeihenmei 阅读(464) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/He_lh/article/details/110522231 在 .Net Core3.1 Web的视图获取从后台传来的数据的时候,默认使用的是 UnicodeRanges.BasicLatin进行的编码,所以在前台显示中文,而在查看源码的时候 阅读全文
posted @ 2024-07-01 09:37 yinghualeihenmei 阅读(55) 评论(0) 推荐(0)
摘要:Services.AddControllers().AddJsonOptions 是一个常用于ASP.NET Core应用程序中配置MVC控制器如何处理JSON的方法。 它允许你添加自定义JSON序列化设置,例如更改日期格式、更改默认的序列化行为等。 以下是如何使用 AddJsonOptions 的 阅读全文
posted @ 2024-06-28 14:05 yinghualeihenmei 阅读(233) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/ZkbFighting/p/12922029.html AddTransient(shuan sen te) 瞬间生命周期 : 每次需要创建一个全新的 AddSigleton(Single ten) 单例进程唯一实例 :每一次请求都是同一个( 阅读全文
posted @ 2024-06-28 11:56 yinghualeihenmei 阅读(516) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/1285026182YUAN/p/17686654.html 以前记录的是在.net framwork中的,是放在global文件中的。现在记录的是在.netcore里的应用,netcore框架里已经没有global文件了。 源码:https 阅读全文
posted @ 2024-06-28 10:50 yinghualeihenmei 阅读(55) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/qq_18932003/article/details/119975014 匹配单个路由匹配固定的单个路径 endpoints.MapControllerRoute( name: "AA", pattern: "About", defaults: 阅读全文
posted @ 2024-06-28 10:04 yinghualeihenmei 阅读(37) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/shanghaibao123/article/details/124116749 下载NuGet包依赖 Microsoft.Extensions.Http 在启动类中配置启用https builder.Services.AddHttpClient 阅读全文
posted @ 2024-06-27 16:35 yinghualeihenmei 阅读(137) 评论(0) 推荐(0)
摘要:原文链接:https://blog.csdn.net/yzj_xiaoyue/article/details/79367901 在 .Net Core Web的视图获取从后台传来的数据的时候,默认使用的是 UnicodeRanges.BasicLatin进行的编码,所以在前台显示中文,而在查看源码的 阅读全文
posted @ 2024-06-27 15:43 yinghualeihenmei 阅读(87) 评论(0) 推荐(0)
摘要:原文链接:https://www.jb51.net/article/251755.htm https://blog.csdn.net/hiose89/article/details/125012881 这篇文章介绍了.Net Core日志记录之第三方框架Serilog 一、前言对内置日志系统的整体实 阅读全文
posted @ 2024-06-27 15:18 yinghualeihenmei 阅读(237) 评论(0) 推荐(0)