C# Design – How to Store Readonly Data for Application Deployment

cdatadesignwpf

I'm developing a desktop application, and this application requires some information to run, but it doesn't change any of this information (the data must be loaded on every execution of the app, but the data is never changed). The data must be stored on the same computer as the app is running (client-side storage?).

It is also better if the user can't easily change this information (assume that they don't have much IT knowledge).

How should I storage this kind of information? A local database? XML that is sent with the application?

I'm using WPF.

Best Answer

A binary file would be the obvious answer, but it depends on how you are loading it - you might as well make life easy for yourself if you can.

XML might be a good choice as there are built in methods in C# for reading this. You could add a checksum to your data, so that if the user alters it, the checksum will no longer match (you need to add a check to make sure the checksum is valid)

A local db might create more problems because you have other dependencies you need to be able to access it

Related Topic