none
Operating class in .net c# RRS feed

  • Question

  • hi all

       by using operating class, i can get all details but i cant get operate system product key,

     please help me.

    Regards

    Selva 

    Friday, August 3, 2012 7:44 AM

Answers

  • you can get the product key from the registry on the machine where the OS is installed. The following code would work.

    RegistryKey registry = null;
    byte[] digitalProductId = null;
    registry = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Office\10.0\Registration\" +                           @"{90280409-6000-11D3-8CFE-0050048383C9}",                           false);
    if (registry != null)
    {
    digitalProductId = registry.GetValue("DigitalProductId")
            as byte[];
            registry.Close();
    }

    This product key could be encoded. You can refer to this link for decoding the product key http://www.codeproject.com/Articles/23334/Microsoft-Product-Key-Finder

    Friday, August 3, 2012 9:25 AM