#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $wk
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1 (" & @ScriptName & ")", 515, 138, 192, 124)
$GLabel1 = GUICtrlCreateLabel("无线网卡 :", 20, 20, 80, 22)
GUICtrlSetFont(-1, 11, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0x990000)
$Input1 = GUICtrlCreateLabel("", 95, 20, 375, 22);, $WS_VSCROLL)
GUICtrlSetFont(-1, 11, 400, 0, "微软雅黑")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $wmi = _wxwk()
If Not @error Then
GUICtrlSetData($Input1, $wk);"无线网卡: " &
GUICtrlSetColor($Input1, 0x009900)
RunWait(@ScriptDir & "\获取网卡MAC地址.exe")
Else
GUICtrlSetData($Input1, "未发现无线网卡")
GUICtrlSetColor($Input1, 0x990000)
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _wxwk();获取网卡信息
$rootCIMV2 = ObjGet("winmgmts:\\.\root\cimv2");检索对象
$jbxxwk = $rootCIMV2.ExecQuery("Select * from Win32_NetworkAdapter Where NetConnectionStatus =2");网卡
For $object In $jbxxwk
$wk = StringStripWS($object.Name, 1)
Next
EndFunc ;==>_wxwk
|