tags:

views:

1177

answers:

4

Looking for C# class which wraps calls to do the following:

read and write a key value read & write a key entry

enumerate the entries in a key. This is important. For example, need to list all entries in: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources

(I scanned through some codeproject.com registry classes and they didn't enumerate)

+4  A: 

Use the standard C# / .NET registry classes and enumerate over the result of GetSubKeyNames().

See here for an example.

Stephen Deken
+13  A: 

Microsoft.Win32.Registry

Kyralessa
+3  A: 

Look in the "Microsoft.Win32" namespace. There you'll find functions for creating and reading registry entries.

   Registry.CurrentUser.OpenSubKey()
   Registry.CurrentUser.CreateSubKey()

etc..

clintp
A: 

I hope this code will help you a lot have a look on this post Registry Iteration in C#

Code is also included in it.

Ummar