如何让ConfigurationManager打开任意的配置文件

 

            string appconfig = System.IO.Path.Combine(context.Bundle.Location, "bin", context.Bundle.Name + ".dll.config");
            ExeConfigurationFileMap map = new ExeConfigurationFileMap();
            map.ExeConfigFilename = appconfig;

            Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
            var supersockt = config.GetSection("superSocket");

 

posted @ 2016-03-18 14:45  baiqjh  Views(245)  Comments(0Edit  收藏  举报