C#类库读取App.config配置文件

   private Configuration readAppConfig()
        {
            string configPath = @"E:\xxx\App.config";
            Configuration config = ConfigurationManager.OpenMappedExeConfiguration( new ExeConfigurationFileMap()
            {
                ExeConfigFilename = configPath
            }, ConfigurationUserLevel.None);

            //MessageBox.Show(config.AppSettings.Settings["serverIp"].Value);
            return config;
        }

http://www.it1352.com/9531.html原文地址

posted @ 2017-06-22 10:07  让风继续吹  阅读(4323)  评论(0编辑  收藏  举报