public void set_Value() { config1 = ConfigurationManager.OpenMappedExeConfiguration(file, ConfigurationUserLevel.None); data1 = config1.Sections["add"] as ConfigSectionData; undeal_Path = Udeal_path.Text = System.IO.Path.Combine(data1.Udeal_path); deal_path = Deal_path.Text = System.IO.Path.Combine(data1.Deal_path); mod = Model_path.Text = System.IO.Path.Combine(data1.mod); CoorRef = Coor_ref.Text = System.IO.Path.Combine(data1.Coor_ref); report = data1.report; }
private void config() { ExeConfigurationFileMap file = new ExeConfigurationFileMap(); file.ExeConfigFilename = "setting.config"; Configuration config = ConfigurationManager.OpenMappedExeConfiguration(file, ConfigurationUserLevel.None); ConfigSectionData data = new ConfigSectionData(); data.Udeal_path = @"G:\未处理数据"; data.Deal_path = @"G:\已处理数据"; data.mod = @"G:\数据转换\项目数据管理\地图模板"; config.Sections.Add("add", data); config.Save(ConfigurationSaveMode.Minimal); }