哈~~~~~~
Imports Microsoft.Win32'引用
'定义
Dim myDec As RegistryKey
Dim myScsi As RegistryKey
Dim myPort As RegistryKey
Dim myBus As RegistryKey
Dim myHd As RegistryKey
Dim myInfo As RegistryKey
Dim myHW As RegistryKey
Dim myLM As RegistryKey
'LocalMachine这个你打开注册表对一下就知道了
myLM = Registry.LocalMachine
'读子键
myHW = myLM.OpenSubKey("HARDWARE")
myDec = myHW.OpenSubKey("DEVICEMAP")
myScsi = myDec.OpenSubKey("Scsi")
myPort = myScsi.OpenSubKey("Scsi Port 1")
myBus = myPort.OpenSubKey("Scsi Bus 0")
myHd = myBus.OpenSubKey("Target Id 0")
myInfo = myHd.OpenSubKey("Logical Unit Id 0")
'得到值
dStr = myInfo.GetValue("Identifier").ToString.Trim & ""
'Msgbox
msgbox (dStr)