public void Test() { CustomSection customSection = CustomSection.GetCustomSection(); customSection.Name += "name "; customSection.Value += "value "; customSection.Save(); }
public static CustomSection GetCustomSection() { Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); CustomSection section = config.Sections["CustomSection"] as CustomSection; if (section == null) { section = new CustomSection(config); config.Sections.Add("CustomSection", section); } return(section); }