Enumerating Registry Keys : Registry : Windows C# Source Code


Custom Search

C# Source Code » Windows » 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);
        Object oValue=UninstallKey.GetValue("DisplayName");
        Console.WriteLine(oValue.ToString());
      }
    }
  }

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Windows
» Registry