I am creating a desktop app that will sit on a PC and occasionally check a web server for updates to various settings.
The program will be using these settings frequently so I would like cache the settings in a file on the PC so it doesn't have to hit the server constantly. There are a lot of settings. I was thinking about storing them in an XML file but I need the file to be unreadable by the PC users.
How should I store the settings on the PC that the program can read and write to but the user cannot read?
EDIT: Sorry guys. The application is being written in C# using .NET 2.0. The application will only run on Windows. It is a console app that will run as a Windows Service.
Assuming that you are targeting the Windows platform, you can either
Data can be encrypted in all 3 cases if needed. If you really have lots of settings, the registry is probably not the easiest way to do this. If you have a .net app, look at SQL Server Compact Edition, it is really light-weight, easy to deploy with your app, and does not need a runtime environment.
If the app is a service then it can run under an account that isn't the user's; then it's easy enough to keep the file hidden from him.
As a Windows app, you have your choice of the Registry or a file or a local database. For files, your choice of a simple properties file or an XML file.
For any of those, your choice of encrypted (just in case) or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With