How To Get The Windows Product Key In VB.NET

Let's get our windows product key from vb.net

Add the function below in your codes
   Public Function ProductKey(ByVal KeyPath As String, ByVal ValueName As String) As String
        Dim HexBuf As Object = My.Computer.Registry.GetValue(KeyPath, ValueName, 0)
        If HexBuf Is Nothing Then Return "N/A"
        Dim tmp As String = ""
        For l As Integer = LBound(HexBuf) To UBound(HexBuf)
            tmp = tmp & " " & Hex(HexBuf(l))
        Next
        Dim Digits(24) As String
        Digits(0) = "B" : Digits(1) = "C" : Digits(2) = "D" : Digits(3) = "F"
        Digits(4) = "G" : Digits(5) = "H" : Digits(6) = "J" : Digits(7) = "K"
        Digits(8) = "M" : Digits(9) = "P" : Digits(10) = "Q" : Digits(11) = "R"
        Digits(12) = "T" : Digits(13) = "V" : Digits(14) = "W" : Digits(15) = "X"
        Digits(16) = "Y" : Digits(17) = "2" : Digits(18) = "3" : Digits(19) = "4"
        Digits(20) = "6" : Digits(21) = "7" : Digits(22) = "8" : Digits(23) = "9"

        Dim HexDigitalPID(15) As String
        Dim Des(30) As String
        Dim tmp2 As String = ""
        Dim StartOffset As Integer = 52, EndOffset As Integer = 67
        For i = StartOffset To EndOffset
            HexDigitalPID(i - StartOffset) = HexBuf(i)
            tmp2 = tmp2 & " " & Hex(HexDigitalPID(i - StartOffset))
        Next
        Dim KEYSTRING As String = ""
        Dim dLen As Integer = 29
        For i As Integer = dLen - 1 To 0 Step -1
            If ((i + 1) Mod 6) = 0 Then
                Des(i) = "-"
                KEYSTRING = KEYSTRING & "-"
            Else
                Dim HN As Integer = 0
                Dim sLen As Integer = 15
                For N As Integer = (sLen - 1) To 0 Step -1
                    Dim Value As Integer = ((HN * 2 ^ 8) Or HexDigitalPID(N))
                    HexDigitalPID(N) = Value \ 24
                    HN = (Value Mod 24)
                Next
                Des(i) = Digits(HN)
                KEYSTRING = KEYSTRING & Digits(HN)
            End If
        Next
        Return StrReverse(KEYSTRING)
    End Function
Now add a button and add this code to button click event.
    MsgBox(ProductKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId"))
Debug and click the button a new message box will pop up with showing your product key.
get product key
:)

34 comments

This looks really nice! You should visist my website also, http://www.premiumhacks.org, maybe we can exchange traffic.

Keep the good work up :)

Reply

for more vb 2012 Tutorials jump over to www.dimz.co.uk/youtube.html

free proxy software @ www.dimz.co.uk/software.html

Reply

Hi
I have tried the code in VB.Net express, but it seems like I am not able to read the key from registry. HexBuf keeps returning 0 (default value). Any ideas on how to troubleshoot this issue?

Reply

What is your operating system?

Reply
Anonymous mod

Could you reverse this at all and get back the digitalproductid from the product key?

Reply

not works

Reply

It's work, Test by VB.Net 2008 with windows 8

Reply

As I understand this works for Windows XP but does anyone know how to get this working on Windows 7?

Reply

Windows 7 Ultimate Product key ( http://www.Buymicrosoftkey.com )

To buy a genuine product key, go to the site Windows 7 Ultimate Product key ( http://www.Buymicrosoftkey.com ) . This is definitely not like some sites which will make you worry about the purchasing safety. The payment process is confidential and guaranteed. More importantly, the product is genuine and with attractive price.

Windows 7 Ultimate Product key ( http://www.Buymicrosoftkey.com )

Reply

Another informative post. I have different knowledges at this task. Thanks for the awesome share. you informed me well.

Reply


upgrade key for window 7 premium free , genuine product key of microsoft office professional plus 2010 free download , key windows 7 ultimate sp1 , windows 8.1 professional key , windows 10 product key , windows multipoint server 2011 activation code , windows 7 product , microsoft windows xp genuine , lHkXGz

Reply

Unable to cast object of type 'System.Int32' to type 'System.Array'.

Reply

Unable to cast object of type 'System.Int32' to type 'System.Array'. Windows 10 VS 2015

Reply

Unable to cast object of type 'System.Int32' to type 'System.Array'. Windows 10 VS 2015

Reply


I got win 8 ebay for my Toshiba Tecra 8000 laptop from http://www.MicrosoftStoreinc.com about 9 weeks ago, you could try.

I purchased Microsoft Office 2003 Basic OEM. Instead, I received Microsoft Office 2003 Standard student edition. Purchsed a software for 3 computers but box only says l pc? Confusing. They did not mention this in their ad. Best service received in a long time. Thank you for the quick delivery. Ordered a retail version of Windows 7 Ultimate. Had the best price around; saved me about $50-100. Order was received promptly. Completed installation of operating system without any issues, everything was legitimate. THANKS A LOT!!! product key windows 7 ultimet geniunwindows anytime upgrade key for windows 7 home premium I've ordered from the website Software before and each time have been pleased with the service. I've found they have the best prices for the products I've ordered, plus the free shipping... can't beat it. Will most definitely order from them again in the future

Reply

windows 10 product key scanner , windows 10 product key generator online , windows 10 serial key , windows 10 activation slmgr , windows 8.1 pro key buy , buy windows 7 product key , windows 10 serial keys redmondpie , cheap office 2016 series key , llq8WA
buy office 2016 product key
windows server 2012 r2 free
rosetta stone french key sale

Reply

windows home server 2011 activation key , download windows 7 starter , office 2016 registry purchase , windows 10 activation y , buy windows 10 activator discount , windows 10 activation youtube , window 7 home premium product key free , windows 7 premium product key free , shvSUN

office 2016 registry purchase

cheap office 2013 key

microsoft visio professional 2016 order

cheap windows 10 product key sale

Reply

windows home server 2011 activation key , download windows 7 starter , office 2016 registry purchase , windows 10 activation y , buy windows 10 activator discount , windows 10 activation youtube , window 7 home premium product key free , windows 7 premium product key free , shvSUN

office 2016 registry purchase

cheap office 2013 key

microsoft visio professional 2016 order

cheap windows 10 product key sale

Reply

it's working, thank you

Reply

WINDOWS 10 PRODUCT KEY

My computer arrived at yesterday. I needed a genuine Windows 10 key at a great price. http://www.microsoftkeyshops.com/ made it happen!
However, I was quite skeptical at them since their price seemed too good to trust. So I tried searching for them on google but with little success.
But I decided to give it a try. I paid with PayPal, and received my key in 20mins!!! I tried the key and it worked!
They exhibited sooooo quick customer service. They are a certified Microsoft partner and a great source for Microsoft, Adobe, Rosetta Stone and other products. Waste no time looking elsewhere.

Reply
This comment has been removed by the author.

Windows 10 Product Key

Just like me, not a master of the computer, I believe many of us may get stuck with the computer problem. Take this question for example, based on my previous experience, I think you have to get a product key to activate your Windows 7 Ultimate SP1 Product Key. Just go to the site http://www.Ms4Key.com// and place your order to buy one. When you pay for it successfully, the genuine product key will be sent to you timely. You can activate your Windows 7 Ultimate SP1 Product Key in several minutes.

Windows 10 Product Key

Reply

www.Gastonfiore.com

I must express my thanks and appreciation to the online product key vendor www.Gastonfiore.com . The guys of the technical department answer my questions and provide the instructions soooooooo professional and patient. The genuine product key I bought is sooooooooocheap and the after-sell service is soooooooo high Professional. The best product key vendor I know so far.

www.Gastonfiore.com

Reply

Windows 10 Product Keys

You can buy the product key from the Microsoft office site and its partner vendor. If you don't want to pay in high price, then I recommend you to buy it from the partner vendor http://www.keysonlinestore.com/ . The same genuine product key but with a much lower price. What's more, the customer service is extremely good and considerate.

Windows 10 Product Keys
Windows 10 Product Keys

You can buy the product key from the Microsoft office site and its partner vendor. If you don't want to pay in high price, then I recommend you to buy it from the partner vendor http://www.keysonlinestore.com/ . The same genuine product key but with a much lower price. What's more, the customer service is extremely good and considerate.

Windows 10 Product Keys

Reply

Windows 10 Product Keys

Hi, there, as for your question, you definitely need to buy a product key to activate your Windows 8.1 activation key. But don't need to worry about how and where to buy the genuine product key. You can go to the professional site http://www.keysonlinestore.com/ . Choose the target product and order it online. The support email will be sent to you at the first time. If you have any other technical questions, you can also communicate with their support team.

Windows 10 Product Keys

Reply

OFFICE 2016 PRODUCT KEY

Hey guy, you need to have the license to activate your Windows 10 key. As for the license, you can buy one from the site http://www.Gastonfiore.com/ . It won't cost much and you can have a genuine product key to activate your operating system. I also bought one from here and had my Windows 10 key activated efficiently. Just have a try and good luck!

OFFICE 2016 PRODUCT KEY

Reply

Post a Comment

Note: Only a member of this blog may post a comment.