16,549
社区成员
发帖
与我相关
我的任务
分享
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim nif As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim curIPfs As IPv4InterfaceStatistics
Dim downFlow As Long, upFlow As Long
curIPfs = nif(ComboBox1.SelectedIndex).GetIPv4Statistics()
downFlow = curIPfs.BytesReceived '/ 1048576
upFlow = curIPfs.BytesSent '/ 1048576
If olddownFlow Or oldupFlow <> 0 Then
上传 = upFlow - oldupFlow
下载 = downFlow - olddownFlow
shuju = "下载:" & vbTab & 下载 & vbTab & "上传:" & vbTab & 上传
End If
olddownFlow = downFlow
oldupFlow = upFlow
My.Computer.FileSystem.WriteAllText(Application.StartupPath & "\" & 时间, Now() & vbTab & shuju & vbCrLf, True)
End Sub