|
|
本帖最后由 lin6051 于 2013-4-9 16:44 编辑
测试多个流量监控软件,最准确的是金山卫士
AU3那个在局域网下检测流量还好, 但adsl拨号下测试,速度就很不准确了
而且在测速下载的时候,上传也会跳到10kb/s往上.
adsl拨号情况下,测速400kb/s,它会显示1m/s多
au3那个源码:- #include <String.au3>
- #include <GUIConstantsEx.au3>
- $Form1 = GUICreate("Form1", 192, 67, 445, 376)
- $Label1 = GUICtrlCreateLabel("上传速度:", 24, 8, 55, 17)
- $Label2 = GUICtrlCreateLabel("0", 88, 8, 100, 17)
- $Label3 = GUICtrlCreateLabel("0", 88, 32, 100, 17)
- $Label4 = GUICtrlCreateLabel("下载速度:", 24, 32, 55, 17)
- GUISetState(@SW_SHOW)
- WinSetOnTop ($Form1,"",1)
- $_IfTable=_GetIfTable()
- Global $_Down=$_IfTable[0]
- Global $_UpDate=$_IfTable[1]
- AdlibRegister ("_Strat_Time",1000)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
- Func _Strat_Time()
- $_IfTable=_GetIfTable()
- GUICtrlSetData ($Label2, Round(($_IfTable[1]-$_UpDate)/1024,2)& " Kb")
- GUICtrlSetData ($Label3, Round(($_IfTable[0]-$_Down)/1024,2) & " Kb")
- Global $_Down=$_IfTable[0]
- Global $_UpDate=$_IfTable[1]
- EndFunc
- Func _GetIfTable()
- $_Return=DllCall("Iphlpapi.dll","long","GetIfTable","ptr",0,"ulong*",0,"int",0)
- $_aBuffer=DllStructCreate("byte[" & $_Return[2] & "]")
- $_Return=DllCall("Iphlpapi.dll","long","GetIfTable","ptr",DllStructGetPtr($_aBuffer),"ulong*",DllStructGetSize($_aBuffer),"int",0)
- $_Number=DllStructCreate("dword",DllStructGetPtr($_aBuffer))
- $_Number=DllStructGetData($_Number,1)
- $_MIB_IFROW="dword" & _StringRepeat(";wchar[256];dword[5];byte[8];dword[16];byte[256]",$_Number)
- $_MIB_IFTABLE=DllStructCreate($_MIB_IFROW,DllStructGetPtr($_aBuffer))
- Dim $_Table[2]
- For $i=2 To $_Number * 5 Step 5
- $_Table[0]+=DllStructGetData($_MIB_IFTABLE,$i+3,4)
- $_Table[1]+=DllStructGetData($_MIB_IFTABLE,$i+3,10)
- Next
- Return $_Table
- EndFunc
复制代码 -----------
如何获取宽带连接的流量?
怎么检测宽带连接是否已连接? |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|