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
 
More
Testimonies

Asynchronous Whois

The following example demonstrates how to perform a Whois query asynchronously.

[C#]

using System;
using aspNetWhois;
namespace ConsoleApplication1
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			Whois w = new Whois( "whois.networksolutions.com", "microsoft.com" );
			IAsyncResult result = w.BeginQuery( new AsyncCallback( MyCallBack ), w );


			Console.WriteLine( "done from main thread" );
			Console.ReadLine();
		}

		static void MyCallBack( IAsyncResult result )
		{
			Whois w = (Whois)result.AsyncState;
			string lookup = w.EndQuery( result );
			Console.WriteLine( lookup );
		}

	}
}





[VB.NET]

Imports aspNetWhois
Module Module1

    Sub Main()
        Dim w As New Whois("whois.networksolutions.com", "microsoft.com")
        Dim result As IAsyncResult = w.BeginQuery(AddressOf MyCallBack, w)


        Console.WriteLine("done from main thread")
        Console.ReadLine()

    End Sub

    Sub MyCallBack(ByVal result As IAsyncResult)
        Dim w As Whois = CType(result.AsyncState, Whois)
        Dim lookup As String = w.EndQuery(result)
        Console.WriteLine(lookup)
    End Sub 'MyCallBack


End Module









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