If you want to replicate tracert then I can be of no help. But if you can
use the exe that comes with windows, what you want to investigate are:
Process class - this will allow you to start execution of the tracert exe
Within this you will want to look into the ProcessInfo class whichwill
allow you to input the parameters.
And you will want to check out the redirection of the stout information
from the process.
You will execute the process and then (sorry not close to VS right now) a
waitforexit on the process to allow it to execute till the end. There are
settings such that it can execute without a cmd window.
You can then take the stdout and present it in a GUI if you want.
Hope this helps
LS
I currently created a simple example using the tracert.exe file in the
windows\system32 folder, but the only issue that I have is that the
application that I created opens the command prompt and then closes
it. Basically what I would like to do is have this application run in
the back ground and send me emails based on route a route change (I
just implemented a failover system for our remote site). The following
is my code (found an example is C# in google groups)
Imports System
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim p As New Process()
Dim pInfo As New ProcessStartInfo()
pinfo.UseShellExecute = False
pInfo.RedirectStandardOutput = True
pInfo.Arguments = "192.168.4.253"
pInfo.WorkingDirectory = "C:\windows\system32"
'this for nt* computers
pInfo.FileName = "tracert"
p.StartInfo = pInfo
p.Start()
Dim sr As System.IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read()
While input <> -1
sb.Append(CChar(ChrW(input)))
input = sr.Read()
End While
MessageBox.Show(sb.ToString())
End Sub
End Class