C# 异步方法处理

1Thread多线程处理

//异步
string temMsg = "";
Thread thread = new Thread(new ThreadStart(() =>
{
    Pro_Order_List.FenPeiCkNo(o.orderId, o.CkNo, opUserNo, opUserName, ref temMsg);
}));
thread.Start();

 

2Task异步处理(.net4.0)

var alltasks = new List<Task>();                       
var thread = Task.Factory.StartNew(() =>
     {
            getKuc(FxsNo, top50, TaskId);
    });
 Task.WaitAll(alltasks.ToArray());

 

posted @ 2018-09-13 14:09  735882640  阅读(197)  评论(0编辑  收藏  举报