ask创建异步线程方式
1.
//使用构造函数接受一个无参的action委托
2、Task task = new Task(() => Console.WriteLine("123"));
task.Start();
3、Task task1 = Task.Run(() => Console.WriteLine("123"));
4、TaskFactory taskFactory = new TaskFactory();
taskFactory.StartNew(() => Console.WriteLine("123"));
TaskFactory taskFactory = Task.Factory;
taskFactory.StartNew(() => Console.WriteLine("123"));
亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论