3 using System
.Diagnostics
;
7 static int frame_count
= 0;
8 public static int Main(string[] args
)
10 AsyncCallback cback
= new AsyncCallback(ResolveCallback
);
11 IAsyncResult res
= Dns
.BeginGetHostEntry("localhost", cback
, null);
12 System
.Threading
.Thread
.Sleep(2000);
15 while (!res.IsCompleted) {
16 System.Threading.Thread.Sleep(20);
18 IPHostEntry ip = Dns.EndGetHostEntry (res);
19 Console.WriteLine (ip);*/
24 AppDomain
.CreateDomain("1").CreateInstance(typeof (Class1
).Assembly
.GetName ().Name
, "Class1");
29 public static void ResolveCallback(IAsyncResult ar
)
31 Console
.WriteLine("ResolveCallback()");
32 StackTrace st
= new StackTrace();
33 frame_count
= st
.FrameCount
;
34 for(int i
= 0; i
< st
.FrameCount
; i
++) {
35 StackFrame sf
= st
.GetFrame(i
);
36 Console
.WriteLine("method: {0}", sf
.GetMethod());
38 Console
.WriteLine("ResolveCallback() complete");
45 AppDomain
.CreateDomain("2").CreateInstance(typeof (Class1
).Assembly
.GetName ().Name
, "Class2");