本帖最后由 zch11230 于 2010-12-21 00:55 编辑
不知道是否通用 在我的XP上可以 我只能想到这样了$i = 1
While 1
$reg = RegEnumKey ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards",$i)
If @error <> 0 Then ExitLoop
$networkcard = RegRead ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"&$reg,"ServiceName")
$name = RegRead ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"&$reg,"Description")
$dhcpyn = RegRead ("HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces"&$networkcard,"EnableDHCP")
If $dhcpyn = 1 Then
MsgBox (0,"Test","网卡"&$name&"为自动获取IP")
ElseIf $dhcpyn = 0 Then
MsgBox (0,"Test","网卡"&$name&"为手动指定IP")
Else
MsgBox (0,"Test","你的电脑还怪耶 ")
EndIf
$i += 1
WEnd
|