.net core 读取配置文件的值


.net core中的配置文件可以存一些自定义的值,我们需要去读取

在配置中添加json:

 "name": "sealee",
  "ConnectionStrings": {
    "SqlServerConnection": "Development.json"
  },
  "JwtSettings": {
    "Issuer": "ss",
    "Audience": "aa",
    "SecretKey": "djwidwhjidwjd"
  },

①介绍

 

 

②控制器中怎么得到对象配置

 

 GetSection,GetChildren,Exists的介绍:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#getsection-getchildren-and-exists

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM