在用户之间共享可写设置
我想使用 .NET 设置设计器/框架在设计时创建应用程序设置,并让应用程序在运行时可写入这些设置。似乎开箱即用,我无法创建可以由应用程序更改并且所有用户在运行应用程序时都可以读取的设置?
我的代码只允许所有用户使用一个应用程序实例,因此冲突不是问题。
到目前为止,我认为我需要创建一个自定义的 SettingsProvider。我希望我能以某种方式继承 LocalFileSettingsProvider 并覆盖文件位置,但找不到方法来做到这一点。
I'd like to use the .NET settings designer/framework to create application settings at design time and have these settings writeable by the application at runtime. It seems out of the box I can't create settings that can be changed by the application and that are read by all users when they run the the application?
I have code that only allows one instance of the application across all users so conflict is not an issue.
So far I think I need to create a custom SettingsProvider. I'm hoping I can somehow inherit from LocalFileSettingsProvider and overwrite the file locations, but can't find a way to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我就是这样做的。现在我需要知道的是我是否需要实现 IApplicationSettingsProvider 才能在版本之间成功迁移设置?欢迎同行评审和评论!
This is how I did it. Now all I need to kn ow is if I need to implement IApplicationSettingsProvider in order to successfully migrate settings between versions? Peer reviews and comments welcome!