本帖最后由 28002673 于 2017-6-7 01:12 编辑
AU3不是万能的,试试这个dos命令 可以判断是百兆还是千兆
wmic path Win32_PerfFormattedData_Tcpip_NetworkInterface get Name,CurrentBandwidth,BytesTotalPersec
自己在千兆模式下运行一次,然后把网卡设置为强制百兆,再运行一次,你就知道了。。。。#include <Constants.au3>
Opt("MustDeclareVars",1)
_test()
Func _test()
Local $foo,$line,$lines
$foo = Run(@ComSpec & ' /c wmic path Win32_PerfFormattedData_Tcpip_NetworkInterface get CurrentBandwidth | find "100" || echo 1001 ', @SystemDir, @SW_HIDE, $STDOUT_CHILD)
$lines = ''
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
$lines &= $line
Wend
Local $var = StringMid($lines, 1, 15)
Local $10000M = 10000000000
Local $1000M = 1000000000
Local $100M = 100000000
Local $10M = 10000000
Local $1001 = 1001
If $var = $10000M Then MsgBox(64,$10000M,"哇,太牛B了,当前链接速度为:万兆")
If $var = $1000M Then MsgBox(64,$1000M,"当前链接速度为:千兆")
If $var = $100M Then MsgBox(48,$100M,"当前链接速度为:百兆")
If $var = $10M Then MsgBox(48,$10M,"当前链接速度为:十兆")
If $var = $1001 Then MsgBox(16,"连接异常","未检到网络连接")
EndFunc
|