在“注册"中存储目标文件或xml文件. [英] storing a object file or xml file in the "Registery"

查看:93
本文介绍了在“注册"中存储目标文件或xml文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将目标文件或xml文件存储在注册表"中并进行恢复.

how i can storing a object file or xml file in the "Registery" and recovery it.

推荐答案

不太清楚,但是看起来这应该有所帮助您可以:读取/写入XML文件,配置文件,INI文件或注册表 [ ^ ]
Not very clear, but it looks like this should help you out: Read/Write XML files, Config files, INI files, or the Registry[^]


在原则上,这是完全可能的.我建议一定要避免这种情况. Microsoft代表对基于注册表的原始设计表示沮丧(很抱歉,现在很难提供证明链接,但这并不那么重要),并采取了完全不同的方法.

鼓励的策略是使用本地用户的数据代替您的应用程序(我很高兴地同意这一点).

通常,您应该执行以下操作:

In principle, it is quite possible. I would recommend to avoid it by all means. Microsoft representatives expressed frustration about original registry-based design (sorry, it''s hard to give a proof link right now, but this is not so important) and took a completely different route.

Encouraged strategy is using local user''s data for your applications instead (and I happily agree with that).

Typically, you should do something like this:

string mySettingsDirectory = System.Environment.GetFolderPath(
   System.Environment.SpecialFolder.LocalApplicationData);



将您的自定义数据存储在此文件夹中.还有其他选择,具体取决于您的目标.

有关更多信息,请参见System.Environment.GetFolderPath重载和System.Environment.SpecialFolder.

—SA



Store your custom data in this folder. There are other options, depending on your goals.

See System.Environment.GetFolderPath overloads and System.Environment.SpecialFolder for more information.

—SA


您不应将文件存储在注册表中;将文件放在特定位置,并在必要时将该位置存储在注册表中.
You should not be storing files in the registry; put the file in a specific location and store the location in the registry if necessary.


这篇关于在“注册"中存储目标文件或xml文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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