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


Product List
 
  "Great app, very easy to use and understand. I've used it for several different things. Sending HTML pages, standard emails, and others. Currently, the CRM application that we developed in ASP.NET sends .asf formatted call recordings dynamically from the system by attaching to an email. I am especially excited about direct writing into the MS SMTP directory as some of these files get quite large. "
Eugene
Interactivethink.com
 
More
Testimonies

Ping using Events

The following example demonstrates how to ping indefinately, using the event driven model.

[C#]

using System;
using aspNetPing;
namespace ConsoleApplication1
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			IcmpClient icmp = new IcmpClient();

			//wire up the recieved event
			icmp.Received += new ReceivedEventHandler( ICMP_OnReceived );

			//ping indefinately
			icmp.Execute( "www.yahoo.com", -1 );

			Console.WriteLine( "done.");
			Console.ReadLine();
		}

		static void ICMP_OnReceived( object sender, ReceivedEventArgs  e )
		{
			ReplyPacket packet = e.Packet;
			Console.WriteLine("Reply from: " + packet.Source.ToString() + ", seq: " + packet.SequenceNumber.ToString() + ", time = " + packet.ReplyTime.ToString() + "ms");
		}

	}
}

[VB.NET]

Imports System
Imports aspNetPing
Module Module1

    Sub Main()
        Dim icmp As New IcmpClient()

        'wire up the recieved event
        AddHandler icmp.Received, AddressOf ICMP_OnReceived

        'ping indefinately
        icmp.Execute("www.yahoo.com", -1)

        Console.WriteLine("done.")
        Console.ReadLine()

    End Sub

    Sub ICMP_OnReceived(ByVal sender As Object, ByVal e As ReceivedEventArgs)
        Dim packet As ReplyPacket = e.Packet
        Console.WriteLine(("Reply from: " + packet.Source.ToString() + ", seq: " + packet.SequenceNumber.ToString() + ", time = " + packet.ReplyTime.ToString() + "ms"))
    End Sub 'ICMP_OnReceived

End Module

 

 

 

 

 

 



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