static void Main(string[] args) { mymethod inv = new mymethod(print); inv.BeginInvoke(null, null); //Asynchronous calling Console.WriteLine("I am Back"); Console.Read(); }
static void Main(string[] args) { inv = new mymethod(Print); //inv += Print2; IAsyncResult tag = inv.BeginInvoke(new AsyncCallback(Callback), null); Console.WriteLine("I am Back 1st"); // Thread.Sleep(5000); Console.WriteLine("I am Back 2"); Console.WriteLine("I am Back 3"); while (flag) { Console.WriteLine("I am Back 3"); } Console.Read(); }
static void Main(string[] args) { inv = new mymethod(Print); inv.BeginInvoke("ahmar", new AsyncCallback(Callback), null); Console.ReadLine(); }
static void CallAsyncTest() { inv = new mymethod(Print); inv.BeginInvoke("Ranjeet", new AsyncCallback(Callback), null); Console.ReadLine(); }