共享 Windows 应用程序设置文件 (*.settings)?

发布于 2024-08-11 16:31:44 字数 232 浏览 11 评论 0原文

我开发了一个桌面应用程序,将安装在本地网络中的几个站点中,我希望 *.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扎心 2024-08-18 16:31:44

如果我是你,我会这样做:

创建一个 App.config,创建一个指向数据库位置的部分。例如:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="dbstring" value="\\bignetwork\db\abc.mdb"/>
    <add key="shareresourcedir" value=value="\\bignetwork\db\resource"/>
  </appSettings>
</configuration>

编译我的应用程序并分发它。所有相关设置都将存储在 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:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="dbstring" value="\\bignetwork\db\abc.mdb"/>
    <add key="shareresourcedir" value=value="\\bignetwork\db\resource"/>
  </appSettings>
</configuration>

Compile my application and distribute it. All the relevant setting will be stored inside yourapp.exe.config. Make sure that the dbstring section ( and all the related ones) are never ever changed across all the computers.

This is it.

撕心裂肺的伤痛 2024-08-18 16:31:44

我想我将通过 ApplicationSettingsBase 的事件。

I think I will handle the retrival and saving of the settings to the DB thru the ApplicationSettingsBase's events.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文