|
-
May 15th, 2009, 05:35 AM
#1
Thread Starter
Junior Member
Application settings, Application resources or Registry?
Hi,
Apologies if this is in the the incorrect forum...
I was wondering if anyone knew the benefits/drawbacks of using either Application settings, Application resources or the good old registry?
As far as i can tell there are no performance or security benefits.
Also when it comes to senesitive data such as database connection strings, what is the best way to store these in terms of security?
-
May 18th, 2009, 02:39 AM
#2
Re: Application settings, Application resources or Registry?
Resources are part of your compiled executable so they are only useful for static data. Because the data is within your executable it is safe from tampering.
Use of application settings is integrated into the Framework so is simple to implement. Settings are stored in the XML config files so they are easily accessible from within the application or they can be hand-edited if that's appropriate.
The Registry should generally be avoided in .NET applications unless you have a specific need to use it.
Connection strings can be stored in the config file and encrypted if required.
-
May 22nd, 2009, 06:58 AM
#3
Thread Starter
Junior Member
Re: Application settings, Application resources or Registry?
Why should the registry be avoided in .Net? what are the disadvantages?
also what do you mean by the "config file"? if the resources are compiled as part of the excutable would it be safe to store the connection string here?
-
May 22nd, 2009, 07:25 AM
#4
Re: Application settings, Application resources or Registry?
Microsoft recommend against using the Registry because it is getting overloaded and has become unwieldy. .NET has added the configuration system specifically for .NET apps to use to store configuration information. The config file is an XML file stored in the same folder as your assembly. You can add one to your project explicitly if you want but there are many operations that will add one automatically because they need to store data in it, like saving a Data Source connection string or adding application settings.
It's a bad idea to store the connection string as a resource because changing it would require recompilation.
-
Dec 3rd, 2009, 04:36 PM
#5
Re: Application settings, Application resources or Registry?
 Originally Posted by jmcilhinney
It's a bad idea to store the connection string as a resource because changing it would require recompilation.
So the best place to store a connection string is... The registry?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Dec 3rd, 2009, 07:31 PM
#6
Re: Application settings, Application resources or Registry?
 Originally Posted by Dave Sell
So the best place to store a connection string is... The registry?
Is that supposed to be a joke?
 Originally Posted by jmcilhinney
The Registry should generally be avoided in .NET applications unless you have a specific need to use it.
 Originally Posted by jmcilhinney
Connection strings can be stored in the config file and encrypted if required.
 Originally Posted by jmcilhinney
Microsoft recommend against using the Registry because it is getting overloaded and has become unwieldy.
 Originally Posted by jmcilhinney
.NET has added the configuration system specifically for .NET apps to use to store configuration information.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|