问题描述
Imports System.Configuration
Imports System.Reflection
公共类AppConfig
私有_config作为配置
私人设置为AppSettingsSection
Public Function GetProperty(propertyName As String)As String
返回_settings.Settings.Item(propertyName).Value
结束功能
Public Sub SetProperty(propertyName As String,propertyValue As String)
_settings.Settings.Item(propertyName).Value = propertyValue
结束点¥
Public Sub New()
_config = ConfigurationManager.OpenExeConfiguration(Assembly.GetEntryAssembly()。Location)
_settings = _config.AppSettings
结束点¥
受保护的覆盖Sub Finalize()
MyBase.Finalize()
_config.Save(ConfigurationSaveMode.Modified)
结束点¥
结束等级
这篇关于我的应用程序Config类没有保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!