本帖最后由 飘云 于 2011-4-2 21:56 编辑
$a = DllStructCreate("wchar wszName[256];dword dwIndex;dword dwType;dword dwMtu;dword dwSpeed;dword dwPhysAddrLen;char bPhysAddr[8];dword dwAdminStatus;dword dwOperStatus;dword dwLastChange;dword dwInOctets;dword dwInUcastPkts;dword dwInNUcastPkts;dword dwInDiscards;dword dwInErrors;dword dwInUnknownProtos;dword dwOutOctets;dword dwOutUcastPkts;dword dwOutNUcastPkts;dword dwOutDiscards;dword dwOutErrors;dword dwOutQLen;dword dwDescrLen;char bDescr[256]")
DllStructSetData($a,2,2);这里最后一个值是网卡序号,不知道为啥,我的有线网卡序号是2
DLLCall("iphlpapi.dll","dword","GetIfEntry","ptr",DllStructGetPtr($a))
msgbox (0,"测试",DllStructGetData($a,"bDescr"));通过bDescr来判断是否是目标网卡
;使用元素名dwOperStatus ,5 为通,0 为断
|