c#event 怎么实现async await
c#event 怎么实现async await
日期:2021-07-01 22:19:12 人气:1
Async/Await
其实也没有什么神秘的,个人觉得就是实现异步主要靠await ,假如一个声明为async的方法,没有使用await关键字,则这个方法在执行的时候就被当作同步方法,这时编译器也会抛出警告提示async修饰的方法中没有使用await,将被作为同步方法使用。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
其实也没有什么神秘的,个人觉得就是实现异步主要靠await ,假如一个声明为async的方法,没有使用await关键字,则这个方法在执行的时候就被当作同步方法,这时编译器也会抛出警告提示async修饰的方法中没有使用await,将被作为同步方法使用。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;