|
发表于 2012-3-15 20:43:38
|
显示全部楼层
Func _EnumIfEntries()
Local $iResult, $tBuffer, $pBuffer, $tIfEntry, $tCount, $aResult[1][10]
$iResult = DllCall("iphlpapi.dll", "dword", "GetIfTable", "ptr", 0, "ulong*", 0, "int", 1)
$tBuffer = DllStructCreate("ubyte Binary[" & $iResult[2] & "]")
$pBuffer = DllStructGetPtr($tBuffer, "Binary")
$iResult = DllCall("iphlpapi.dll", "dword", "GetIfTable", "ptr", $pBuffer, _
"ulong*", $iResult[2], "int", 1)
$tCount = DllStructCreate("ulong NumberofEntries", $pBuffer)
$aResult[0][0] = DllStructGetData($tCount, "NumberofEntries")
Redim $aResult[$aResult[0][0] + 1][10]
$pBuffer += 4
For $i = 1 To $aResult[0][0]
$tIfEntry = DllStructCreate($tagMIB_IFROW, $pBuffer)
$pBuffer += DllStructGetSize($tIfEntry)
$aResult[$i][0] = DllStructGetData($tIfEntry, "Name")
$aResult[$i][1] = DllStructGetData($tIfEntry, "Descr")
$aResult[$i][2] = DllStructGetData($tIfEntry, "Index")
$aResult[$i][3] = DllStructGetData($tIfEntry, "Type")
$aResult[$i][4] = DllStructGetData($tIfEntry, "Speed")
$aResult[$i][5] = DllStructGetData($tIfEntry, "PhysicalAddr")
$aResult[$i][6] = DllStructGetData($tIfEntry, "AdminStatus")
$aResult[$i][7] = DllStructGetData($tIfEntry, "OperStatus")
$aResult[$i][8] = DllStructGetData($tIfEntry, "InOctets")
$aResult[$i][9] = DllStructGetData($tIfEntry, "OutOctets")
$tIfEntry = 0
Next
$tBuffer = 0
Return SetError($iResult[0], 0, $aResult)
EndFunc ;==>_EnumIfEntries
$aResult[$i][4] = DllStructGetData($tIfEntry, "Speed") 这个就是网卡速度,你多在论坛搜索一下,有这方面的资料! |
|