1.14.2. fejezet, Registry

namespace SpecificProjects
{
    class Program
    {        
        public static Object getRegistryText()
        {
 
            string keyName = @"HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\pcmcia";
            string valueName = "Start";
            Object value = Registry.GetValue(keyName, valueName, null);
            return value;
        }
 
        static void Main(string[] args)
        {
            Object value = getRegistryText();
            if (value == null)
            {
                Console.WriteLine("pcmci is null");
            }
            else
            {
                Console.WriteLine("pcmci:" + value);
            }            
            Console.ReadKey();
        }
    }
}

Nyomtatók lekérdezése

            RegistryKey rkSubKey = Registry.CurrentUser.OpenSubKey(@"Printers\Settings", false);
            foreach (String name in rkSubKey.GetValueNames())
            {
                Console.WriteLine(name);             
            }