Enumerating Registry Keys : Registry : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Registry »

 

Enumerating Registry Keys








    



using System;
using Microsoft.Win32;

class Class1 {
    static void Main(string[] args) {
        RegistryKey myRegKey = Registry.LocalMachine;
        myRegKey = myRegKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall");
        String[] subkeyNames = myRegKey.GetSubKeyNames();
        foreach (String s in subkeyNames) {
            RegistryKey UninstallKey = Registry.LocalMachine;
            UninstallKey = UninstallKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + s);
            try {
                Object oValue = UninstallKey.GetValue("DisplayName");
                Console.WriteLine(oValue.ToString());
            } catch (NullReferenceException) {
            }
        }
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Registry