共享 Windows 应用程序设置文件 (*.settings)?
我开发了一个桌面应用程序,将安装在本地网络中的几个站点中,我希望 *.settings 在程序加载时从数据库中获取设置,并将其保存在 SaveChanges 上。
我不关心以哪种方式做到这一点(我认为 SQL 效果最好,因为这是用户之间唯一共同的事情,如果你没有更好的想法),我的观点是拥有通用的设置文件所有车站。
我需要技术细节,请向我推荐一些好的链接或资料。
谢谢
I develop a desktop application that will be installed in few stations in the local network, I want the *.settings to fetch the settings from the DB when the program loads, the save it on SaveChanges.
I don't care in which way to do it (I thought SQL would work best as this is the only common thing between the users, if you don't have better ideas), my point is to have settings file that is common to all the stations.
I need technicial details, please refer me to some good links or stuff.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我是你,我会这样做:
创建一个 App.config,创建一个指向数据库位置的部分。例如:
编译我的应用程序并分发它。所有相关设置都将存储在
yourapp.exe.config
中。确保dbstring
部分(以及所有相关部分)在所有计算机上从未发生更改。就是这样。
I would do this if I were you:
Create an App.config, create a section that points to the location of your db. For example:
Compile my application and distribute it. All the relevant setting will be stored inside
yourapp.exe.config
. Make sure that thedbstring
section ( and all the related ones) are never ever changed across all the computers.This is it.
我想我将通过
ApplicationSettingsBase
的事件。I think I will handle the retrival and saving of the settings to the DB thru the
ApplicationSettingsBase
's events.