Friday, March 30, 2007

C# Class for Routine Registry Lookups

Say you need to store a lot of application configuration data in the system registry. Why would you need to do this, when you can use various .NET .config files?

The idea may seem kind of archaic, but you may work with web servers that have been around a long time, where legacy ASP and ASP.NET applications cohabitate. Different applications that live on these servers were probably written by different groups separate by geography and time. Standards become important in such an environment! Registry use is not an uncommon standard.

Okay, that's the long scenario explanation... Should you need to make repeated trips to a registry key or its subkeys, here is a C# class to facilitate. The functions make use of the static Microsoft.Win32.Registry object.

Example of usage:


Please Note: to read registry settings successfully, the authenticated user of the ASP.NET application must have read access to the specified registry key.

3 comments:

  1. Can anyone recommend the top performing Network Monitoring system for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central support network
    ? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

    ReplyDelete
  2. Great site!!! this information really helped me

    ReplyDelete