首页 > 其他分享 >Core读取配置

Core读取配置

时间:2024-01-22 16:56:33浏览次数:31  
标签:Core 读取 25 配置 workflowFilterAll var configuration TTTTT

Core 获取配置文件

 

public class UploadService
{

//实例化配置节点
private readonly IConfiguration configuration;
public UploadService(IConfiguration configuration)
{
this.configuration = configuration;
}}

//获取配置文件值

var    connStr = configuration.GetSection("ConnectionStrings")["AA"];

}

 

appseting.json:

 

{
"Counts": {
"IGBT": 7,
"IGCT": 5
},
"ConnectionStrings": {
"PP": "TTTTT",
"AA": "TTTTT",
"BB": "TTTTT",
"FactoryCodes": "111,222,333,444,555,666,777",
"TraceTest": "TTTTT",
"TTke": "sTTTTT"

}
}

 

 

var configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build();
var workflowFilterAll = configuration["AuthCheck"];

 

var configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build();
var workflowFilterAll = configuration["workflowFilterAll"];

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"AuthCheck": "False",
"ConnectionStrings": {
"SQLServerConnString": "SATAWTEWA",
"RedisConnectionString": "TTTTTTT"
},
"KPIItemConfig": {
"Step1BaseTime": 240,
"Step2BaseTime": 240,
"Step3BaseTime": 120,
"Step4BaseTime": 30,
"Step1Weight": 25,
"Step2Weight": 25,
"Step3Weight": 25,
"Step4Weight": 25,
"BaseScore": 80,
"ExtendTime": 10,
"ExtendScore": 8
},
"KPIYearsConfig": {
"ResponseRateWeight": 25,
"AbnormalTimesWeight": 25,
"GreatAbnormalTimesWeight": 25,
"CloseRateWeight": 25,
"AbnormalBaseCount": 50,
"AbnormalScoreReduction": 5,
"GreatAbnormalBaseCount": 0,
"GreatAbnormalScoreReduction": 50
},
"workflowFilterAll": "AAA",

"workflowFilter": "BBB",
"workflowId": "CCC",
"OAAutoLogin": "DDD",
"HostIpAddr": "CCC",
"mainTableName": "formtable_",
"appId": "1EEE",

"BelongCampus": "ZT"

}

标签:Core,读取,25,配置,workflowFilterAll,var,configuration,TTTTT
From: https://www.cnblogs.com/zhan-shuai/p/17980444

相关文章

  • SQL 2016 AlwaysOn 无域AlwaysOn配置要点
    环境准备:(1)操作系统:WindowsServer2016Datacenter (2)SQLServer2016  配置SQL 2016AlwaysOn要点  1,因为没有域所以需要在”计算机属性“添加计算机的DNS后缀。如后缀是:kk1.com  2,非账户Administrator(是管理员组的新账号也不行),需在运行下列命令以管理员方式运行Po......
  • 配置AlwaysON出错
     在其中一个集群节点的SQLServer中验证各节点的投票数,在其中一个集群节点的SQLServer上执行使用下面SQL语句SELECT*FROMsys.dm_hadr_cluster_members;SELECT*FROMSYS.[dm_hadr_cluster] 7、再次确保各节点已经关闭防火墙,如果防火墙没有关闭,那么在创建可用性组的时候会......
  • 配置SQL 2012的AlwaysOn高性能组件
         AlwaysOn取数据库镜像和故障转移集群之长。AlwaysOn不再像故障转移集群那样需要共享磁盘,从而主副本和辅助副本可以更容易的部署到不同的地理位置;AlwaysOn还打破了镜像只能1对1的限制,支持最多5个可用性伙伴,使得辅助副本不仅能用于高可用性的目的,还能用于只读访问,甚至可以......
  • Linux基础45 firewalld防火墙, 参数, 区域配置, 放行策略, 端口转发, 富规则, 防火墙
    firewalld防火墙一、防火墙安全概述在Centos7系统中继承了多款防火墙管理工具,默认启动的是firewalld(动态防火墙管理器)防火墙管理工具,Firewalld支持CLI(命令行)以及(图形)的两种管理方式。对于接触Linux较早的人员对Iptables比较熟悉,但由于Iptables的规则比较的麻烦,并且对网络有......
  • DataSet 读取/压缩 /解压
     //从数据库读取dataset,压缩写入wenjianMssqlHelperdb=newMssqlHelper(GlobalSetting.ConnectString);DataSetds=db.ExecuteDataSet("select*fromdim_goods");byte[]bytesData=GetBytesFromDataSet(ds......
  • Fiddler安装及配置
    一、安装官网下载地址(最新版本):https://www.telerik.com/download/fiddler1.下载步骤:在谷歌浏览器打开下载网址,翻译为中文网页,根据提示下载到电脑常用磁盘下载地址网页:DownloadFiddler→HowdoyouplantouseFidder?(此处任选一个答案)Youremail(填写你的邮箱地址)Coun......
  • MySQL-8.3.0 innovation 创新版本YUM安装配置
     MySQL-8.3.0innovation版本已发布了,想抢先体验一下最新的功能,可以用以下的方式快速在虚拟机上安装一下哈 服务器环境:[root@node213~]#cat/etc/redhat-releaseCentOSLinuxrelease7.9.2009(Core)[root@node213~]#uname-aLinuxnode2133.10.0-1160.el7.x86_64#1......
  • NetCore 统一格式(错误异常)
    使用方式:thrownewResponseException("未授权,操作失败"); 异常输出:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceMicro.Core.Utility{[Serializable]publicclassRe......
  • Windows下CLion配置Cygwin
    目录说明Cygwin下载地址安装Cygwin打开安装程序选择安装目录选择软件包目录选择镜像站点选择安装的软件包下载软件包安装完成CLion下载地址安装配置Cygwin创建新项目执行程序总结说明安装CLion需要配置C++编译环境,常见的有五种,MinGW,Cygwin,VisualStudio,WSL,RemoteHost。首先,WSL......
  • Cordova环境安装与配置
    Node不建议使用太高的版本,18.19.0就足够了nvmlistavailablenvminstall18.19.0nvmuse18.19.0nvmlsnpmconfiggetregistryhttps://registry.npmmirror.com/ npmconfigsetregistryhttps://registry.npm.taobao.orgnpmconfiggetregistry npminstall-gcord......