简体   繁体   English

C#/ WPF:将用户设置保存在资源文件中

[英]C#/WPF: Save User Settings in Ressource file

有没有办法将用户设置保存在Ressource-File或类似的文件中,因为我希望用户看不到.xml-File。

I would recommend your applications .config file or resource files for application specific settings. 我建议您将应用程序.config文件或资源文件用于特定于应用程序的设置。 This is the common way of doing things. 这是做事的常见方式。

WPF Resources WPF资源

ConfigurationManager 配置管理器

The normal way to do this is to use a standard .settings file with settings set to user scope. 通常的方法是使用标准.settings文件,并将其设置设置为user范围。 While these files are stored as XML, they are hidden by default in the AppData folder of each user. 虽然这些文件存储为XML,它们在默认情况下隐藏的AppData每个用户的文件夹中。 In my opinion, any user that can work out where their settings file is stored is welcome to change them. 我认为,欢迎任何可以确定其设置文件存储位置的用户进行更改。

Please take a look at the Using Settings in C# page on MSDN for full details. 请查看MSDN上C#中的“ 使用设置”页面以获取完整详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM