Task代码如下:
Task t = new Task(() =>
{
//do something
while (true)
{
}
});
t.ContinueWith((task) =>
{
try
{
task.Wait();
}
catch (AggregateException ex)
{
foreach (Exception item in ex.InnerExceptions)
{
}
}
},TaskContinuationOptions.OnlyOnFaulted);
t.Start();
Copyright © 2004-2024 Ynicp.com 版权所有 法律顾问:建纬(昆明)律师事务所 昆明市网翼通科技有限公司 滇ICP备08002592号-4