Configuration variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,


What is the best way to store the configuration varaibles of the application (E.g: Registry, Web Config file, Xml file , text file etc)?

E.g: of configuration variable is

*Connection string
*Support Links
*# of retiries to SQL Server before exiting.

What i am looking for is the an highly fast way to access the variables( As it will involve disk operation) and also secure.Not inclined to user Registry -- if i have better option.

Thoughts on the above will be appreciated.

Thanx in advance

Regards
Vineet Batta
 
"Best" depends on your circumstances. The Registry is cool in that it's
easy to use and can store config settings for different users. On the other
hand, not everyone is chomping at the bit to let you hit their registry.
But, the registry does make it harder for people to inadvertantly screw up
your key values and helps to obscure them.

Config files are great and easy to use, but currently they don't let you
write to them, and a user can delete one and cause all sorts of drama.
Here's an example of using a .Config file..
http://www.knowdotnet.com/articles/configfiles.html

On a web app or something more suited to a single user (single user in the
sense of that the app runs only under one or a few logons regardless of how
many users are being served by your app) .config files are probably the way
to go. If you have a ton of people all of whom store custom settings, the
registry might be easier to use.

Also, factor in people tampering with your settings. Most folks have been
warned about messing with the registry, so your average user doesn't go
hacking around it. Someone probably won't delete or play with a .config
file, but in general it's easier to get to.

IMHO, go with the config files though...clean, easy to use, easy to
manipulate etc.
vineetbatta said:
Hi all,


What is the best way to store the configuration varaibles of the
application (E.g: Registry, Web Config file, Xml file , text file etc)?
E.g: of configuration variable is

*Connection string
*Support Links
*# of retiries to SQL Server before exiting.

What i am looking for is the an highly fast way to access the variables(
As it will involve disk operation) and also secure.Not inclined to user
Registry -- if i have better option.
 
Vineet,

The better option would be the config file only. The configuration sections themselves are section handler classes and pre-compiled and loaded to memory. If you want to have a secured configuration file, consider encrypting the connection strings using a signature.

http://weblogs.asp.net/shawnfa/archive/2004/01/22/61779.aspx

HTH
Sudhakar Sadasivuni
Microsoft .NET MVP | MCAD
http://weblogs.asp.net/ssadasivuni
www.mugh.net

----- vineetbatta wrote: -----

Hi all,


What is the best way to store the configuration varaibles of the application (E.g: Registry, Web Config file, Xml file , text file etc)?

E.g: of configuration variable is

*Connection string
*Support Links
*# of retiries to SQL Server before exiting.

What i am looking for is the an highly fast way to access the variables( As it will involve disk operation) and also secure.Not inclined to user Registry -- if i have better option.

Thoughts on the above will be appreciated.

Thanx in advance

Regards
Vineet Batta
 
In this case the thier will single user setting for the all the users. Probably this will be done by the admin
Secondly accessing the Configurations varibles from Web.config file than accessing from Registry will be faster

Secondly the Admin can manually go and modify the Config file to have new set of values for the variables..... as long he does not mess up the XML. :-

Thanx Ryan

Batt

----- William Ryan eMVP wrote: ----

"Best" depends on your circumstances. The Registry is cool in that it'
easy to use and can store config settings for different users. On the othe
hand, not everyone is chomping at the bit to let you hit their registry
But, the registry does make it harder for people to inadvertantly screw u
your key values and helps to obscure them

Config files are great and easy to use, but currently they don't let yo
write to them, and a user can delete one and cause all sorts of drama
Here's an example of using a .Config file.
http://www.knowdotnet.com/articles/configfiles.htm

On a web app or something more suited to a single user (single user in th
sense of that the app runs only under one or a few logons regardless of ho
many users are being served by your app) .config files are probably the wa
to go. If you have a ton of people all of whom store custom settings, th
registry might be easier to use

Also, factor in people tampering with your settings. Most folks have bee
warned about messing with the registry, so your average user doesn't g
hacking around it. Someone probably won't delete or play with a .confi
file, but in general it's easier to get to

IMHO, go with the config files though...clean, easy to use, easy t
manipulate etc
vineetbatta said:
Hi all
*Support Link
*# of retiries to SQL Server before exiting
As it will involve disk operation) and also secure.Not inclined to use
Registry -- if i have better option
 
Back
Top