c# 读取app.config遇到生成X.config.config问题

string exePath = System.IO.Path.Combine(Environment.CurrentDirectory, "WindowsFormsApp.exe");
            // Get the configuration file.
            Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);
            AppSettingsSection appSettings = config.Sections["appSettings"] as AppSettingsSection;
            MessageBox.Show(appSettings.Settings["test"].Value);

posted on 2015-08-17 18:38  绝处而逢生  阅读(368)  评论(0编辑  收藏  举报

导航