将 dotnet 应用程序设置存储在数据库中而不是 app.config 中
到目前为止,我已将所有应用程序(键值对)设置存储在 Windows 窗体应用程序的 app.config 中。我想更改它,因为
- 我应该按用户存储设置(不是赢用户,而是我的应用程序用户),
- 有一些必须存储的机密设置
- 我有几个客户端,连接到同一个数据库,所以一个应用程序用户可以从任何客户端登录,
- 写入配置文件可能会出现问题,因为给定 Windows 用户的应用程序文件夹可以是只读的,
为此目的使用配置非常舒服,但由于这些问题,我无法使用它。
我的问题是,是否有一个开箱即用或经过充分测试、广泛使用的库/类/方式可以从数据库读取/写入键值对设置?
I have stored all my application (key-value pair) settings in the app.config so far in my Windows Forms application. I'd like to change it, because
- I should store settings by user (NOT win user, but my app user)
- there are some confidential settings that must be stored
- I have several clients, that connects to the same db, so one app user can log in from any client
- there can be problems writing to config files, cause app folder fro a given windows user can be read-only
Using config for this purpose is very comfortable, but I can not work with it on because of these problems.
My question is, if there is an out-of-the box or well tested, widely used library/class/way that can read/write key-value pair settings from a database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我正确理解您的问题,您希望存储应用程序的每用户配置信息。您可能想尝试 ASP.NET 配置文件属性(自 2.0 起可用)。该功能与通常用于安全性的角色提供程序非常吻合。
http://msdn.microsoft.com/en-us/library/ie /2y3fs9xs.aspx。
If I understand your problem correctly, you want to store per-user configuration information for your application. You might want to try ASP.NET Profile Properties (available since 2.0). The functionality dovetails nicely with the Role Provider, which is commonly used for security.
http://msdn.microsoft.com/en-us/library/ie/2y3fs9xs.aspx.
您可以查看Cinchoo Framework。您可以使用“配置存储插件',这是Cinchoo配置框架的扩展。使用它,您可以编写自己的自定义配置 piug-in 并在您的应用程序中使用它们。希望有帮助。
You can look out the Cinchoo Framework. You can do it using 'Configuration Storage Plug-in', which is the extension of Cinchoo configuration framework. Using it you can write your own custom configuration piug-in and use them in your application. Hope it helps.