-1

In my C# windows application (using visual C# 2012 if you need to know) I need to add things to listboxes and save the items so when the program closes they stay there next time it opens. I would prefer not using the settings to store the information.

Some more things I need for this. Saving them to a text file can't happen either. It needs to be saved in a way that it can not be edited outside of the program.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880

3 Answers3

1

Sorry but its not possible. Anything that you save can be modified by another program.

You could sign the saved data and then detect that some other has modified the data, but you cannot prevent other programs from read/changing the data.

EDIT

DPAPI can be used to encrypt/decrypt the data. See Really simple encryption with C# and SymmetricAlgorithm

Community
  • 1
  • 1
Richard Schneider
  • 34,944
  • 9
  • 57
  • 73
0

Set up SQL on a web server.

Save the info to your web server.

They can't modify data on a remote server, so I think a database is the way to go.

prospector
  • 3,389
  • 1
  • 23
  • 40
0

If you are the only person using that program... I mean... if you are the only one that knows what the program is doing, you could go for saving data in binary format into binary files. I doubt that someone looking at your files will say "Oh damn there is a .bin file in this directory! I have to find a way to discover how to read it and what's it's content!".

As long as you keep your program and its sources protected... I doubt someone will get something out of that content. You transform all your data into a Byte[], you compress it, you encrypt it and you write in a file. Bye bye.

Tommaso Belluzzo
  • 23,232
  • 8
  • 74
  • 98