Home | Contact Us | Download | Support | Purchase | Products

Product List
  "Of the 10 asp.net components I have bought and used over the years, yours have easily been the cleanest, and easiest to start using. Your components were up and running in production faster than any other components I have bought over the last 10 years. Thank you! "
Mike Otten

TraceRoute using Events

The following example demonstrates how to perform a simple TraceRoute to the remote host, www.yahoo.com, using the event driven model.


using System;
using aspNetTraceRoute;
namespace ConsoleApplication1
	class Class1
		static void Main(string[] args)
			TraceRouteClient client = new TraceRouteClient();
			client.ReceivedReply += new ReceivedReplyEventHandler( Client_OnReply );
			client.TraceRoute( "www.yahoo.com" );

			Console.WriteLine( "done.");

		static void Client_OnReply( object sender, ReceivedReplyEventArgs e )
			//write out the response
			Console.WriteLine( e.Packet.ToString() );

			//if we wanted to cancel the traceroute, uncomment the following line
			//e.Cancel = true;



Imports System
Imports aspNetTraceRoute
Module Module1

    Sub Main()
        Dim client As New TraceRouteClient()
        AddHandler client.ReceivedReply, AddressOf Client_OnReply

    End Sub

    Sub Client_OnReply(ByVal sender As Object, ByVal e As ReceivedReplyEventArgs)
        'write out the response
        'if we want to canel the traceroute, uncomment the following line
        'e.Cancel = True

    End Sub

End Module

The box is not shipped. aspNetTraceRoute is a downloadable product.