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. "

Ping using Events

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


using System;
using aspNetPing;
namespace ConsoleApplication1
	class Class1
		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.");

		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");



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)


    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.