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

Product List
  "I've been working for 2 days on an SQL Server Extended Stored Procedure (as a DLL in C++) which would extract a preview from complete email message text stored in the database. Then I found aspNetMime, downloaded the demo and had the whole thing working in 5 minutes. Another 2 minutes to purchase. Brilliant! Thanks, folks!"
Roger Lainson
SDR Clinical Technology

Asynchronous Ping

The following example demonstrates asynchronously ping a host.


using System;
using aspNetPing;
namespace ConsoleApplication1
	class Class1
		static void Main(string[] args)
			IcmpClient icmp = new IcmpClient();
			IAsyncResult result = icmp.BeginExecute( "www.yahoo.com", 4, -1, new AsyncCallback( MyCallback ), icmp );

			Console.WriteLine( "done.");

		static void MyCallback( IAsyncResult result )
				IcmpClient icmp = (IcmpClient)result.AsyncState;
				ReplyPacketCollection rpc = icmp.EndExecute( result );
				Console.WriteLine( rpc.ToString() );
			catch( Exception ex )
				Console.WriteLine( ex.Message );



Imports System
Imports aspNetPing
Module Module1

    Sub Main()
        Dim icmp As New IcmpClient()
        Dim result As IAsyncResult = icmp.BeginExecute("www.yahoo.com", 4, -1, AddressOf MyCallback, icmp)


    End Sub

    Sub MyCallback(ByVal result As IAsyncResult)
            Dim icmp As IcmpClient = CType(result.AsyncState, IcmpClient)
            Dim rpc As ReplyPacketCollection = icmp.EndExecute(result)
        Catch ex As Exception
        End Try
    End Sub 'MyCallback

End Module







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