#include <Access.au3>
#include <Array.au3>
#include <file.au3>
Local $regreturn,$aRecord
reg()
_ArrayDisplay($regreturn)
For $n=1 To UBound($regreturn)-1
id($regreturn[$n])
_ArrayDisplay($aRecord, "每个值")
Next
;id("PCI\VEN_1002&dev_5940")
Func id($Find)
Dim $yo
$adSource = @ScriptDir & "\HwidDB.mdb"
$adTable = "easydrv"
$adCol = "hwid"
;$Find = "PCI\VEN_11AB&DEV_4320"
$adFull = 1
$yo = _accessQueryLike($adSource, $adTable, $adCol, $Find, $adFull)
;_ArrayDisplay($yo, "返回值")
If IsArray($yo) Then
For $i=1 To $yo[0]
$aRecord = StringSplit($yo[$i], Chr(28))
;_ArrayDisplay($aRecord, "每个值")
Return $aRecord
Next
EndIf
EndFunc
Func reg()
Dim $key="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI",$regreturn[1]
For $i = 1 to 100
$var = RegEnumKey($key, $i)
if @error <> 0 Then ExitLoop
For $n=1 To 100
$subvarname=$key&""&$var
$subvar=RegEnumKey($subvarname,$n)
If @error <> 0 Then ExitLoop
$aaa=RegRead($subvarname&""&$subvar&"","class")
;If $aaa = "system" Or $aaa = "display" Or $aaa = "net" Or $aaa="hdc" Or $aaa="media" Or $aaa="usb" Then
$hdid=RegRead($subvarname&""&$subvar&"","HardwareID")
$bb=StringSplit($hdid,@CRLF)
;_ArrayDisplay($bb)
If UBound($bb)>5 Then
$cc=StringSplit($bb[1],"&")
;_ArrayDisplay($cc)
$regre=$cc[1]&"&"&$cc[2]
Else
$cc=StringSplit($bb[1],"&")
;_ArrayDisplay($cc)
$regre=$cc[1]&"&"&$cc[2]&"&"&$cc[3]
EndIf
_ArrayAdd($regreturn,$regre)
Next
next
Return $regreturn
EndFunc
|