I'm wondering the best way to store data, say i run the application and change something, how do i save it so that i can acess it every time i run the app. i was thinking about text files but they pose a security risk, i was wondering if DLL files can work like this or any other way to do this?
C# Storing Data
Collapse
X
-
Look into Resource (.resx) files.
But if you can, I would suggest a database. You can password protect them, and they offer an extreme amount of flexibility. -
You can also use the registry. .NET provides a nice easy to use interface and best of all, you can encrypt data.
If you really want something portable - so something you can move between systems, then encrypted files are also an option. Again all of the required classes are part of .NET.
HthComment
-
Also look into the System.Runtime. Serialization Namespace.
and at the overview: MSDN - Serialization
Essentially, you can take any class, or any collection of data, and write it out as a "series" of bits to a file.
Deserializing means you read the bits back into your application and re-create the original object or collection of values.
If you use binary serialization, the files are not humanly readable. If encrypted as well, they can be fairly safe.
Just another Framework option with its pros and cons to consider.Comment
Comment