static int Thread1(int a,int b) {
Console.WriteLine("Thread1");
return a + b;
}
Func<int, int, int> th = Thread1;
th.BeginInvoke(5, 3, ar =>
{
int result = th.EndInvoke(ar);
Console.WriteLine("结果:" + result);
}, null);ar是IAsyncResult类型自动传给回调函数的
EndInvoke(ar) 获取线程(委托方法)的返回值