简体   繁体   English

C#Windows 8.1应用程序对用户隐藏设置和数据

[英]C# Windows 8.1 app hide settings and data from user

I'm building a Windows Store app with C#, and I have certain data and settings that I need to persist between sessions. 我正在使用C#构建Windows Store应用程序,并且我需要在会话之间持久保存某些数据和设置。 Right now I'm doing this with local files, but for some of it, I don't want the users to be able to edit the files. 现在,我正在使用本地文件进行此操作,但是对于某些文件,我不希望用户能够编辑文件。 I currently thwart that by using "scary" file names and obfuscated data, but I want better security, but also don't want to have to jump to my cloud service just to pull their settings, because I want functionality when internet connectivity doesn't exist. 我目前通过使用“吓人的”文件名和模糊的数据来阻止它,但是我想要更好的安全性,但也不想跳到我的云服务只是为了拉动它们的设置,因为我想要在Internet连接不正常时的功能。不存在。

How do I do this? 我该怎么做呢? I feel like this is something that should be pretty commonly used feature in apps. 我觉得这应该是应用程序中非常常用的功能。

I never worked on Windows 8/8.1 apps, so maybe there is some integrated feature to do what yout want, but I didn't find anything on that subject. 我从来没有在Windows 8 / 8.1应用程序上工作过,所以也许有一些集成功能可以完成您想要的事情,但是在这个主题上我什么都没找到。 In fact, what I found seems to indicate the opposite : 实际上,我发现的似乎相反

If you want the data of your Windows Store app to be secured, you have to do it by yourself. 如果要保护Windows Store应用程序的数据安全,则必须自己完成。

Depending on the desired level of security you could try using some form of encryption for your local files. 根据所需的安全级别,您可以尝试对本地文件使用某种形式的加密。 This would make the settings unreadable by the user, and prevent them to tamper with it. 这将使用户无法读取设置,并防止他们篡改设置。

But as pointed in Windows 8 Apps - Local Storage Security , encryption might not be the best way if you really want to make sure the data cannot be edited outside your app, since it is possible to extract the key from your app and decode the data. 但是正如Windows 8 Apps-Local Storage Security中指出的那样,如果您真的想确保无法在应用程序外部编辑数据,则加密可能不是最佳方法,因为可以从应用程序中提取密钥并解码数据。

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

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