asp.net core 读取配置

var configuration = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("appsettings.json")
.Build();

DBUtility.ConfigInfo.ServerName = configuration.GetSection("Data:ServerName").Value;

posted on 2019-02-01 15:07  刘顺利  阅读(101)  评论(0)    收藏  举报

导航