RegistryKey还是本地.ini文件? [英] RegistryKey or local .ini file?

查看:74
本文介绍了RegistryKey还是本地.ini文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个WPF桌面应用程序,该应用程序构建为一个独立的.exe文件。为了保持便携的感觉,我将应用程序的设置存储在当前用户注册表中的"Software\OVLauncher"键下,据我所知,这是我的应用程序所特有的
,而不是本地.ini文件。在我的应用程序中,设置选项卡中还有一个按钮,允许用户删除整个注册表项树。


我的问题是是否会有任何安全例外,例如没有权限,如果应用程序是在非管理员帐户上运行的,例如访客帐户或辅助帐户。


我不想实施本地.ini文件,如果此类问题将会不会发生。

解决方案

您好,


感谢您在此发帖。


您是否尝试使用访问控制模型? 


访问控制模型使您能够控制
进程
访问 
安全对象
或执行各种系统管理任务。


应用程序可以将部分注册表保存在文件中,然后将文件内容加载回注册表。当操作大量数据,在注册表中创建许多条目,或者
数据是暂时的并且必须加载然后再次卸载时,注册表文件很有用。备份和恢复部分注册表的应用程序可能使用注册表文件。


要将密钥及其子项和值保存到注册表文件,应用程序可以调用 

RegSaveKey

RegSaveKeyEx
功能。


最好的问候,


Hart



I am working on a WPF desktop application, which builds into a single standalone .exe file. In order to maintain a portable feel, I am storing the app's settings in the current user registry, under the key "Software\OVLauncher", which as far as I know is unique to my application, rather than a local .ini file. In my app, there is also a button in the settings tab which allows the user to delete the entire registry key tree.

My question is whether there will be any security exceptions, such as no permission, if the app is run on a non-admin account, such as a guest or secondary account.

I do not want to implement a local .ini file if such issues will not occur.

解决方案

Hi,

Thank you for posting here.

Did you try to use the access control model? 

The access control model enables you to control the ability of a process to access  securable objects or to perform various system administration tasks.

Applications can save part of the registry in a file and then load the contents of the file back into the registry. A registry file is useful when a large amount of data is being manipulated, when many entries are being made in the registry, or when the data is transitory and must be loaded and then unloaded again. Applications that back up and restore parts of the registry are likely to use registry files.

To save a key and its subkeys and values to a registry file, an application can call the  RegSaveKey or RegSaveKeyEx function.

Best Regards,

Hart


这篇关于RegistryKey还是本地.ini文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆