API for registry

  • Thread starter Thread starter Lumpierbritches
  • Start date Start date
L

Lumpierbritches

Is there an API call to get registry information for the CD Key in Windows and
other applications that would be installed, if someone were to loose the key or
misplace it. I'm attempting to write an application that will recover these
keys for my internal use.

Any help would be appreciated. This is a second post, the first one, someone
suggested calling Micrsoft, they'd give them one. I know this information is in
the Registry on the computer, just not sure how to pull it to use on a
reinstallation.

Michael
 
* (e-mail address removed) (Lumpierbritches) scripsit:
Is there an API call to get registry information for the CD Key in Windows and
other applications that would be installed, if someone were to loose the key or
misplace it. I'm attempting to write an application that will recover these
keys for my internal use.

I doubt that all of these keys are stored in the registry. Use the
'Microsoft.Win32.Registry' class to access the registry (see
documentation on this class for samples).
 
Hi,

Here is how to get the window product id from the registry on
windows xp. Not sure where to find the cd key.

add to top of file
Imports Microsoft.Win32

Some code
Dim myReg As RegistryKey = Registry.LocalMachine
Dim MyRegKey As RegistryKey
Dim MyVal As String

MyRegKey = myReg.OpenSubKey("Software\Microsoft\Windows
NT\CurrentVersion")
MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()
txtRegistry.Text = String.Format("Product ID {0}", MyVal)


Ken
 
Back
Top