我们可以将一些节点配置到项目的web.config文件中,那么在service中如何获取配置的值呢?
我们可以使用System.Configuration.ConfigurationManager类.
var section = ConfigurationManager.GetSection(“system.web/httpRuntime”) as System.Web.Configuration.HttpRuntimeSection;
参数为section name.
c#获取项目Web.config文件中的配置
最新推荐文章于 2020-07-09 09:48:11 发布