Results 1 to 8 of 8

Thread: PerformanceCounter question.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    PerformanceCounter question.

    I have a function that will get the present upload and download rate of my current connection.

    It is working now here is my code used:

    Code:
     
            Dim NetSent As New System.Diagnostics.PerformanceCounter
            Dim NetReceived As New System.Diagnostics.PerformanceCounter
    
    
            Dim KBytesSent As Long
            Dim KBytesReceived As Long
    Do Until Me._Stop
                    KBytesSent = Convert.ToInt32(Math.Round(NetSent.NextValue / 1024, 0, MidpointRounding.AwayFromZero))
                    Me.StatusUP.Text = KBytesSent & " kB/s"
                    KBytesReceived = Convert.ToInt32(Math.Round(NetReceived.NextValue / 1024, 0, MidpointRounding.AwayFromZero))
                    Me.StatusDown.Text = KBytesReceived & " kB/s"
                    Threading.Thread.Sleep(1000)
                Loop
    That code is working..
    However if try to use other speed meter I got different readings..
    See image.. my app is #1 in image..

    what could be the difference to my codes?
    Last edited by dr_aybyd; Dec 9th, 2010 at 01:16 AM.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width