// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using Microsoft.Win32; namespace E { class MainClass { public static void Lookup(RegistryKey key) { string[] subkeys = key.GetSubKeyNames(); foreach(string sk in subkeys) { Lookup(key.OpenSubKey(sk)); } string[] vals = key.GetValueNames(); foreach(string v in vals) { string data = key.GetValue(v).ToString(); Console.WriteLine(key.Name + @"\" + v + "=" + data); } } public static void Main(string[] args) { Lookup(Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Mozilla")); } } }