Code

using System;
//csc delegate_asynccallback.cs
namespace ConsoleApplication1
{
delegate string MyDelegate(string str);

class MainClass
{
public static void Main(string[] args)
{
MyDelegate del = new MyDelegate(Ping);
AsyncCallback callback = new AsyncCallback(Pong);
IAsyncResult ar = del.BeginInvoke("Hello", callback, null);

while (!ar.IsCompleted)
{

Ping("This is Ping");
Console.WriteLine("waiting to hear Pong");
}

Console.ReadLine();
}
// Create a method for a delegate.
public static string Ping(string message)
{
string str1 = message;
Console.WriteLine(str1);
return str1;
}
//static void Pong(IAsyncResult ar)
static void Pong(IAsyncResult ar)
{
string str = (string)ar.AsyncState;
Console.WriteLine("Here Pong Repies :" +str);
}
}
}