November 29, 2006

Reading the Registry in c#

private static void GetMachineGuid()
{
    string machineGuid = string.Empty;
    RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Cryptography");
    machineGuid = (string)rk.GetValue(@"MachineGuid");
    Console.WriteLine("MachineGuid: " + machineGuid);
}

No comments: