void Main()
{
Run d=new Run(RunHandler);
IAsyncResult result= d.BeginInvoke(new AsyncCallback(CallBack),new string[]{"sdf","sdffd"});
IAsyncResult res=d.BeginInvoke(r=>{},"");
//i.e. asyncresult is a wrapperclass that wraps the state
d.EndInvoke(d.BeginInvoke(re=>{Console.WriteLine (re.AsyncState);},"async state"));
d.EndInvoke(result);
Console.WriteLine (3);
}
void RunHandler(){
Console.WriteLine (1);
}
void CallBack(IAsyncResult result){
Console.WriteLine (result.AsyncState);
Console.WriteLine (2);} // Define other methods and classes here
public delegate void Run();

  


result showed like:

1
1 5String[] (2 items)4
sdf
sdffd 2
1
3

  

void Main()
{
Console.WriteLine (Geta().Result);
} // Define other methods and classes here
async Task<String> Get(){
return "aa";
}
async Task<string> Geta(){
var a=await Get();
return "bb"+a;
}

  

最新文章

  1. UIApplication详解
  2. php中读写excel表格文件示例。
  3. C 文件读写2
  4. 初学者对Spring MVC的认识
  5. Map的3种遍历[轉]
  6. STM32F0xx_DMA收发USART数据配置详细过程
  7. 一、cocos2dx概念简介
  8. js数据转换
  9. Ubuntu 不支持 rpm
  10. linux压缩及vi操作
  11. Java多线程学习之wait、notify/notifyAll 详解
  12. mysql5.6 绿色免安装版 安装详解
  13. 背包DP入门小笔记01背包
  14. JMeter Concurrency Thread Group阶梯式加压
  15. zookeeper(zkCli)命令概览
  16. C语言memcpy函数的用法
  17. C#语法——事件,逐渐边缘化的大哥。
  18. vue组件之间的通信
  19. mongodb shell 运行js脚本的四种方式
  20. bzoj 1002

热门文章

  1. 该网页无法正常运作 目前无法处理此请求HTTP ERROR 500?
  2. 三、Shell 传递参数
  3. goaccess实现实时监控
  4. shell与python判断文件是否存在
  5. 两台centos之间使用scp命令传输文件
  6. jsp中的文件上传
  7. JZOJ 1267. 路障
  8. linux的发展过程
  9. iOS SDK中使用NSXMLParser解析XML(iphone网络篇三)
  10. Android BadgeView 工具包