Пример #1
0
        /// <summary>
        /// 根据key获取配置项的值(相对于Path路径)
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string this[string key]
        {
            get
            {
                return(_root[ConfigurationPath.Combine(Path, key)]);
            }

            set
            {
                _root[ConfigurationPath.Combine(Path, key)] = value;
            }
        }
Пример #2
0
 /// <summary>
 /// 获取配置区块下的子区块
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public IConfigurationSection GetSection(string key) => _root.GetSection(ConfigurationPath.Combine(Path, key));