Windows 10应用程序。不同用户组的特定设置 [英] Windows 10 App. Specific settings for different groups of users

查看:260
本文介绍了Windows 10应用程序。不同用户组的特定设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我正在开发一个Windows 10应用程序来替换桌面应用程序。该应用程序由不同的公司使用,因此每个都有不同的设置。在桌面应用程序中,用户使用文本文件作为许可证密钥,然后在注册表中存储各种设置。 (相同的许可证
文件适用于同一家公司的所有人。)

I am developing a Windows 10 app to replace a desktop app. The app is used by different companies so each have different settings. In the desktop app the user uses a text file as a license key which then stores various settings in the registry. (Same license file is for all in the same company).

对于Windows 10应用程序,我需要做些什么。我意识到使用注册表可能不是最好的方法。

What would i have to do to do that for a Windows 10 app. I realise using the registry may not be the best way.

因此用户安装应用程序,应用程序意识到它没有设置,提示用户输入许可证文件,读取文件,在某处存储设置。

So user installs app, app realises it does'nt have its settings, prompts user for licence file, reads files, stores settings somewhere.

设置类似于访问密码和用户名到ftp,数据库等等。数据位置等。

The settings are things like access passwords and usernames to ftp, database, etc. Location of data, etc.

如何最好地处理这个问题?

Any ideas how this would be best handled?

提前致谢

推荐答案

对我而言,您最好的选择是使用例外的app.config以及使用ConfigurationManager。

To me, your best option is to use an excepted app.config along with using the ConfigurationManager.

https://www.codeproject.com/Articles/18209/Encrypting-the-app-config-File-for-Windows- Forms-A

注意:如果在创建exe的项目中使用app.config,这是一个独立的可执行文件,那么在成功构建项目时,应用程序, config被复制到名为progr的运行时配置中amname.exe.config将使用programname.exe位于Bin文件夹
中。哟部署programname.exe然后必须将运行时部署到同一位置,以便.Net可以找到该文件。

Note: If using an app.config in a project that creates an exe, a standalone executable, then upon the successful build of the project, the app,config is copied over to a runtime config called programname.exe.config that will be sitting in the Bin folder with the programname.exe. Yo deploy the programname.exe then the runtime must be deployed to the same location so that .Net can find the file.


这篇关于Windows 10应用程序。不同用户组的特定设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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