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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 204k
  • Answers 204k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Anchor information (the part starting with the #) is never… May 12, 2026 at 8:45 pm
  • Editorial Team
    Editorial Team added an answer The problem with your code is that inside wrap, your… May 12, 2026 at 8:45 pm
  • Editorial Team
    Editorial Team added an answer AuthName "Restricted Area" AuthType Basic AuthUserFile /path/to/file/.htpasswd <Files "protected.html"> Require… May 12, 2026 at 8:45 pm

Related Questions

I am trying to implement Camera application in android,and i got some code from
I'm developing an Windows Forms application that requires me to call a separate program
Allow me to start with: I am a n00b on ASP.NET MVC. I love
How can I fix this RegEx to optionally capture a file extension? I am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.