问题描述
目前在dotnet中保存用户首选项的首选方法是什么?
注册表是否适合这样做?任何人都可以为这个主题推荐一篇好文章(或
书)?谢谢。
What is the current preferred way to save user preferences in dotnet? Is the
registry the right place to do this? Can anyone recommend a good article (or
book) for this topic? Thanks.
推荐答案
对于桌面应用程序,将信息保存在每用户注册表项或XML格式的每个用户文件夹中保存的
文件中。我在我的
书中对此进行了一些讨论,但坦率地说,这些方法的文档相当简单。
直截了当。请参阅Application.UserAppDataPath上的帮助和
Application.UserAppDataRegistry。请记住,每个版本的应用程序都会为这些
位置生成新文件夹和注册表
键,因此您需要开始管理你之前的版本号
开始使用这些属性。
-
米奇威廉姆斯
作者,Microsoft Visual C#.NET核心参考,MS Press
For a desktop app, save information in per-user registry keys, or in XML
files kept in per-user folders. I have some discussion about this in my
book, but frankly the documentation for the methods is fairly
straightforward. See the help on Application.UserAppDataPath and
Application.UserAppDataRegistry. Keep in mind that new folders and registry
keys will be generated for each version of your app that writes to these
locations, so you''ll want to start managing your version numbers before you
start using these properties.
--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
这篇关于目前在dotnet中保存用户首选项的首选方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!