Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
- Dim grp As ConfigurationSectionGroup = config.SectionGroups("userSettings")
- If grp Is Nothing Then
- Return
- End If
- Dim section As ClientSettingsSection = grp.Sections(userSectionName)
- Dim setting As SettingElement = New SettingElement(name, SettingsSerializeAs.String)
- Dim eltValue As SettingValueElement = New SettingValueElement()
- Dim element As XmlElement = New XmlDocument().CreateElement("value")
- element.InnerText = value
- eltValue.ValueXml = element
- setting.Value = eltValue
- section.Settings.Add(setting)
- config.Save(ConfigurationSaveMode.Modified)
- 'config.Save(ConfigurationSaveMode.Full)
- 'My.MySettings.Default.Save()
- ConfigurationManager.RefreshSection("userSettings")
- My.MySettings.Default.Reload()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement