Results 1 to 3 of 3

Thread: trace route in vb 2008 express

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2009
    Posts
    98

    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 ?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: trace route in vb 2008 express

    Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum

  3. #3
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    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

Tags for this Thread

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