' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Configuration

Namespace E
    Public Class Program
        Public Shared Function GetSetting(name As String) As Boolean
            Return Boolean.Parse(ConfigurationManager.AppSettings(name))
        End Function
        Public Shared Sub SetSetting(name As String, val As Boolean)
            Dim cfg As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
            cfg.AppSettings.Settings(name).Value = val.ToString()
            cfg.Save(ConfigurationSaveMode.Modified)
            ConfigurationManager.RefreshSection("appSettings")
        End Sub
        Public Shared Sub Main(args As String())
            Console.WriteLine(GetSetting("chkbox"))
            SetSetting("chkbox", True)
            Console.WriteLine(GetSetting("chkbox"))
        End Sub
    End Class
End Namespace
