Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 158557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:42:09+00:00 2026-05-11T10:42:09+00:00

I am trying to code to capture the packet loss on computers, but the

  • 0

I am trying to code to capture the packet loss on computers, but the only way I’ve been able to do so was to run the NetStat.exe and the TraceRt.exe processes and capture them to a listbox (using the code below):

Private Sub myProcess()     Dim p As System.Diagnostics.Process     Dim theFile, sTemp, sLineOut, mySent, myRetrans As String     Dim intSentStart As Double     Dim isEnabled As Boolean      p = New System.Diagnostics.Process     theFile = t.Name      If File.Exists('c:\windows\system32\' & theFile) Then         theFile = 'c:\windows\system32\' & theFile     Else         MessageBox.Show('Unable to find the ' & theFile & ' file on your computer.', 'File Find Error!', MessageBoxButtons.OK, MessageBoxIcon.Error)     End If      Select Case t.Name         Case 'TraceRt.exe'             p.StartInfo.Arguments = '-h 30 www.stackoverflow.com'          Case 'NetStat.exe'             p.StartInfo.Arguments = '-s -p tcp'     End Select      Try         p.StartInfo.FileName = theFile         p.StartInfo.CreateNoWindow = True         p.StartInfo.UseShellExecute = False         p.StartInfo.RedirectStandardOutput = True         p.Start()         p.PriorityClass = System.Diagnostics.ProcessPriorityClass.Normal          sLineOut = ''          Do While Not p.HasExited             sTemp = p.StandardOutput.ReadLine()             If sTemp <> '' Then                 sLineOut = sLineOut & sTemp & vbNewLine                 'Send to listbox                 setTrace(sTemp)             End If         Loop         If sLineOut = '' Then             'Clear Listbox             clearTrace()             myProcess()             Exit Sub         End If         If t.Name = 'NetStat.exe' Then             Try                 If lboxTrace.Items.Count < 9 Then                     'Clear Listbox                     clearTrace()                     myProcess()                     Exit Sub                 End If                 mySent = ''                 mySent = lboxTrace.Items.Item(8) '('Segments Sent')                 mySent = Trim(mySent.Replace('Segments Sent', ''))                 mySent = Trim(mySent.Replace('=', ''))                  myRetrans = ''                 myRetrans = lboxTrace.Items.Item(9)                 myRetrans = Trim(myRetrans.Replace('Segments Retransmitted', ''))                 myRetrans = Trim(myRetrans.Replace('=', ''))                  intSentStart = Math.Round((myRetrans / mySent) * 100, 2)                  'setTrace sends data to the listbox                 If intSentStart < 2 Then                     setTrace('Your Current Packet Loss is: ' & intSentStart & '%.')                     setTrace('Your packet loss is within acceptable ranges.')                 Else                     setTrace('Your Current Packet Loss is: ' & intSentStart & '%.')                     setTrace('Your packet loss is below acceptable ranges!')                     setTrace('Please contact your Internet Provider about your Internet Connection.')                 End If              Catch ex As Exception                 'Clear Listbox                 clearTrace()                 myProcess()                 Exit Sub             End Try         End If     Catch ex As Exception         MessageBox.Show(ex.Message)     End Try  End Sub 

Does anyone have a better idea to get this information? I’d rather use managed code instead of hacking through it this way.

Thanks in Advance! -JFV

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:42:10+00:00Added an answer on May 11, 2026 at 10:42 am

    Not sure if this is what you’re looking for, but have you taken a look at the Ping class?

    Edit: Actually for TraceRoute, take a look at the answers here: TraceRoute and Ping in C#.

    For Netstat, take a look at http://towardsnext.wordpress.com/2009/02/09/netstat-in-c/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying capture UIIMage with UIGraphicsBeginImageContext(); but my code capture the whole screen
I've been trying to code a Perl script to substitute some text on all
I trying to capture packets using SharpPcap library. I'm able to return the packets
I'm trying to capture the queries which my code submits to the database by
I've been tearing my hair out trying to get the AVFoundation camera to capture
I am trying to capture from a Sony Handicam DCR-HC38, running the code below,
I am trying to take a picture with camera , but after capture a
I'm trying to create a quick piece of code to capture the key sequence
I am trying to code TDD style in PHP and one of my biggest
I am trying to code a flowchart generator for a language using Ruby. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.