想做驱动识别吗?
给个枚举PCI设备的范例。#include <Array.au3>
Local $regreturn,$aRecord
reg()
_ArrayDisplay($regreturn)
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")
$hdid=RegRead($subvarname&""&$subvar&"","HardwareID")
$bb=StringSplit($hdid,@CRLF)
If UBound($bb)>5 Then
$cc=StringSplit($bb[1],"&")
$regre=$cc[1]&"&"&$cc[2]
Else
$cc=StringSplit($bb[1],"&")
$regre=$cc[1]&"&"&$cc[2]&"&"&$cc[3]
EndIf
_ArrayAdd($regreturn,$regre)
Next
next
Return $regreturn
EndFunc
|