Jango
Jango

Reputation: 5545

Where to keep config data other than config file (Windows App)?

My Windows application GUI is accepting some required application configuration fields from the user. I need to store them of course, but I wanna hide these fields from the user.

  1. I cannot use database to store these configs.
  2. I want to avoid using app.config either. (No app.config encryption)

Any suggestions, Where and in which format i should store fields. (Field example is: Accepting database User credentials, Task Schedule info etc.)

Upvotes: 1

Views: 185

Answers (5)

Nate
Nate

Reputation: 30656

I would use an XML file (encrypt if you feel its necessary) and use

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

to store it in the %AppData% section of the user's file system.

Additionally, you may write a Settings class which you serialize to disk and deserialize to memory -- this could save you some persistance logic with the XML namespace.

Upvotes: 1

Andrew Lewis
Andrew Lewis

Reputation: 5254

These are possible: (but crazy and bad ideas): 1. Registry 2. Create your own custom settings file 3. Encrypt them 4. Write a web service api and store them on a web server

Upvotes: 1

Adam Crossland
Adam Crossland

Reputation: 14213

It's called The Windows Registry. I hate to recommend the use of it, but I think that it fits your requirement and its use quite ubiquitous.

Upvotes: 0

Andre
Andre

Reputation: 1107

Encrypt the details to an XML file?

Use rijndael encryption that you can decrypt when you need it.

Upvotes: 0

Chris Taylor
Chris Taylor

Reputation: 53729

You can always write your own XML file and use the .NET cryptography classes to encrypt the data.

http://msdn.microsoft.com/en-us/library/ms229749.aspx

Upvotes: 0

Related Questions