Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I already googled it, but currently have not found an answer.

I'm thinking about storing application settings. So I can use the .NET ConfigurationManager to use a user.config in %AppData%. One possible way is to store the information in a registry key.

But when comparing them both how is the speed? I'm guessing the user.config is slower because each request has to open, read and close the file. And the registry is running completely in the memory by launching Windows.

Maybe anyone knows more?

What I have tried:

I already searched via Google, but found nothing.
Posted
Updated 21-Jan-22 9:45am
v2
Comments
PIEBALDconsult 21-Jan-22 14:34pm    
I generally use XML files in either
APPDATA -- User-specific
or
ProgramData -- Global to all users
The Registry is evil; don't use it.
Sascha Manns 21-Jan-22 14:38pm    
Can you tell me more? What are the difficulties with registry?

1 solution

A major problem with the Registry is portability. The Registry is specific to Windows only. That means you cannot use it if you port your code over to other platforms, like phones.

If all you're doing is storing a small list of settings, speed isn't a concern at all. Reading/writing to file or registry is going to be negligible.

Oh, and the Registry isn't completely "in memory". It has to be stored somewhere or else the entire thing will disappear when you shutdown Windows. It's stored in files in the system and user profiles.

Today, the Registry is basically being discouraged because of abuse, portability, bloat, backup and restore difficulties, and fixing possible corruption.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900