asp.net core 读取配置

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

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

猜你喜欢

转载自www.cnblogs.com/liushunli/p/10345912.html