用户范围设置的持久性在哪里出了问题?
我有一个布尔值、用户范围的设置。我通过一个名为“Settings”的引用类库来访问它。该类库有一个带有属性的模块:
Module AppSettings
Public Property MyBooleanSetting() As Boolean
Get
Return My.Settings.MyBooleanSetting
End Get
Set(ByVal value As Boolean)
My.Settings.MyBooleanSetting = value
My.Settings.Save()
End Set
End Property
End Module
我在设置类库的属性页中定义了设置。
当其他代码操作该设置时,它将使用如下代码:
Settings.MyBooleanSetting=True
当代码运行时,此操作有效。但重新启动应用程序后,新值不会保留。 我哪里出错了?
I have a Boolean, user scoped setting. I access it through a referenced class library, called Settings. This class library has a Module with properties:
Module AppSettings
Public Property MyBooleanSetting() As Boolean
Get
Return My.Settings.MyBooleanSetting
End Get
Set(ByVal value As Boolean)
My.Settings.MyBooleanSetting = value
My.Settings.Save()
End Set
End Property
End Module
I defined the setting in the Property pages of the Settings class library.
When other code manipulates the setting it will use code like:
Settings.MyBooleanSetting=True
While the code is running this works. But after a restart of the application the new value is not persisted.
Where am I going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

查看 在 Visual Basic 2005 中使用 My.Settings MSDN 文章并这些MSDN 论坛 线程 ,我会说您需要验证正在使用哪个路径。
After looking at the Using My.Settings in Visual Basic 2005 MSDN article and these MSDN Forum Threads , I would say you need to verify which path is being used.