|
-
Jun 10th, 2010, 01:44 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Read Windows Product Key (C#)
Hi guys!
I am writing a CSIT (Complete System Information Tool) as you may know from other threads I have made recently. I am trying to read the Windows serial key but unfortunately without much success.
I have found an example piece of code here (see the GetXPCDKey function) but it does not seem to work in Windows Vista or Windows 7 but works fine in Windows XP.
Does anyone know of an example code like the above that will work with Windows & and Vista?
This would be a nice addition to the tool if anyone has any ideas.
Cheers.
-
Jun 10th, 2010, 07:08 PM
#2
Re: Read Windows Product Key (C#)
Hmm.
Is this legal, even if you own the xp,win7 cd legally?
Check it out before you include the function.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jun 11th, 2010, 02:15 AM
#3
Thread Starter
Frenzied Member
Re: Read Windows Product Key (C#)
Yes. other software (quite expensive and popular software) has this feature. Tampering with the key probably isn't legal but that isn't what I am looking to do here.
-
Jun 11th, 2010, 09:23 AM
#4
Thread Starter
Frenzied Member
Re: Read Windows Product Key (C#)
Actually. I figured this out anyway. The above code does work but you need to ensure that you read the correct key - I forgot that 64-bit Windows systems use a different registry structure - D'oh!
I solved this by using |RegistryKey.OpenBaseKey| set with the |RegistryView| based on the OS architecture type. It works great now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|