trace route in vb 2008 express
hey everyone,
im looking to do a trace route to an ip (specified in a text box) and have the results displayed in a textbox. I know that this has been brought up in the forums before but im yet to find a version thats compatible with vb 2008 express edition. The vb.netmvps example is exactly the functionality im looking for but it throws up 80 +errors(*** is no longer supported etc)
http://vbnet.mvps.org/index.html?cod...et/tracert.htm
the host resolution isnt an issue becasue i already have the list of ip's and corresponding host names that i would be tracing in a db.
does anyone have a tracert app that is compatible with this version of vb or indeed know where i could find one ?
Re: trace route in vb 2008 express
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
Re: trace route in vb 2008 express
Here's an example reading StandardOutput from tracert.exe.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MessageBox.Show(ReturnShellResults("tracert.exe", "www.google.com"))
End Sub
Private Shared Function ReturnShellResults(ByVal exeName As String, Optional ByVal args As String = "") As String
Dim p As New Process
With p.StartInfo
.FileName = exeName
.Arguments = args
.UseShellExecute = False
.RedirectStandardError = True
.RedirectStandardInput = True
.RedirectStandardOutput = True
.WindowStyle = ProcessWindowStyle.Hidden
.CreateNoWindow = True
End With
Dim result As String
Try
p.Start()
result = p.StandardOutput.ReadToEnd()
p.WaitForExit()
Catch ex As Exception
result = ex.ToString
Finally
p.Dispose()
End Try
Return result
End Function