标签:
using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Xml.Linq; namespace rooxml { public class main { public delegate void AsyncEventHandler (); [STAThread] public static void Main () { main m = new main (); AsyncEventHandler asy = new AsyncEventHandler(m.Event1); IAsyncResult ia = asy.BeginInvoke (null, null); m.Event2 (); asy.EndInvoke (ia); } void CallbackMathod(AsyncEventHandler ar){ } void Event1(){ Console.WriteLine ("e1 is start"); System.Threading.Thread.Sleep (2000); Console.WriteLine ("e1 is end"); } void Event2(){ Console.WriteLine ("e2 is start"); int i = 1; while (i < 1000) { i++; Console.WriteLine (i.ToString()); } Console.WriteLine ("e2 is end"); } } }
标签:
原文地址:http://www.cnblogs.com/nnnnn/p/4524872.html