到目前为止我有这个代码
require 'win32/registry'
Win32::Registry::HKEY_LOCAL_MACHINE.open('Software\Microsoft\Windows NT\CurrentVersion',Win32::Registry::KEY_ALL_ACCESS) do |reg|
puts reg['DigitalProductId']
end
但它不允许我获得 DigitalProductId 值。有些值可用,但有些不可用。
CurrentVersion
CurrentBuild
SoftwareType
CurrentType
InstallDate
RegisteredOrganization
RegisteredOwner
SystemRoot
InstallationType
EditionID
ProductName
CurrentBuildNumber
BuildLab
BuildLabEx
BuildGUID
CSDBuildNumber
PathName