1
평균 속도를 얻기 위해 인터넷 연결의 트래픽, 즉 특정 시간의 평균 속도를 모니터링하려고합니다. 이 코드를 시도했지만 작동하지 않습니다. 내가 어디로 잘못 가고 있니?대역폭 모니터링 시스템
Function bwmonitor()
Dim pc As New PerformanceCounterCategory("Network Interface")
Dim instance As String = pc.GetInstanceNames(0)
Dim bs As New PerformanceCounter("Network Interface", "Bytes Sent/sec", instance)
Dim br As New PerformanceCounter("Network Interface", "Bytes Received/Sec", instance)
Dim k As Integer = 0
Do
k = k + 1
Dim kbsent As Integer = bs.NextValue()/1024
Dim kbRecieved As Integer = br.NextValue/1024
TextBox10.Text = kbsent
TextBox11.Text = kbRecieved
Threading.Thread.Sleep(1000)
Loop Until k = 10
Return 0
End Function
나는 함수를 호출했지만 텍스트 상자는 0 만 반환합니다.
thanx, 나는 여전히 도전하고있다. 나는 여전히 내 WindowsApplication과 통합하려고한다. 뭔가를 보내거나받는 평균 대역폭을 표시하는 데 도움이됩니다 변수에 할당 좋아해. –
또한 인터페이스 9를 사용 중입니다 –
GUI 부분을 해결했습니다 [Windows 콘솔 대역폭 모니터] (http://stackoverflow.com/questions/16264927/windows-console-bandwidth-monitoring-system) –