4 Replies - 1423 Views - Last Post: 23 August 2012 - 05:04 AM Rate Topic: -----

#1 <aris>  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 24-August 11

Value from registry returns null

Posted 21 August 2012 - 04:08 PM

Hello I am trying to get a value from registry but it returns nothing!

I am using the following snippet:

Dim hwid As Object
hwid = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID", "ClientHWID", "...")
Textbox1.Text = hwid


What am I doing wrong here? And how to fix this?

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Value from registry returns null

#2 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 48
  • View blog
  • Posts: 221
  • Joined: 10-March 12

Re: Value from registry returns null

Posted 21 August 2012 - 04:18 PM

try it this way:

Dim regKey As RegistryKey
        regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\MSLicensing\HardwareID", True)
        If regKey IsNot Nothing Then
            regKey.GetValue("ClientHWID", "...")
        End If


Was This Post Helpful? 1
  • +
  • -

#3 <aris>  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 24-August 11

Re: Value from registry returns null

Posted 22 August 2012 - 01:04 AM

Thank you for your help!!

I just tried your recommendation and it returns nothing again.

It helps if I say that the value I am trying to get from registry ("ClientHWID") is in binary format?
Was This Post Helpful? 0
  • +
  • -

#4 <aris>  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 24-August 11

Re: Value from registry returns null

Posted 23 August 2012 - 05:02 AM

Ok solved. The problem was that I was running the app as 32bit whereas my windows version is 64bit.

I've set the debugger to x64 mode and everything's just fine!
Was This Post Helpful? 0
  • +
  • -

#5 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 48
  • View blog
  • Posts: 221
  • Joined: 10-March 12

Re: Value from registry returns null

Posted 23 August 2012 - 05:04 AM

good job, im glad i could help! :)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1