c#异步task示例分享(异步操作)
2014-03-20 15:59
651 查看
c# Task异步操作
复制代码 代码如下:using System;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
Func<string, string> _processTimeFunc = new Func<string, string>((string arg) =>
{
return string.Format("{0} {1}", arg, DateTime.Now);
});
Task.Factory.FromAsync<string, string>(_processTimeFunc.BeginInvoke, _processTimeFunc.EndInvoke, "Zhuzhou", null)
.ContinueWith((result) =>
{
Console.WriteLine(result.Result);
});
Console.ReadLine();
}
}
}
您可能感兴趣的文章:
相关文章推荐
- c#异步task示例分享(异步操作)
- Linux查看磁盘空间命令分享
- 最好的HTML 5编码教程和参考手册分享
- 分享12个效果精美的 JavaScript 倒计时脚本
- 一款由张鹏老师录制的一周HOLD住HTML+CSS视频教程分享给大家
- 分享一些比较重要的算法
- 慕课网“顶尖分享”上线,时效课程赢得用户芳心
- node.js下LDAP查询实例分享
- GeekBand--第八周分享
- 社会化分享插件使用心得
- 走过最长的路是你的套路(PS调色-V客学院技术分享)
- AI专家分享:深度学习入门应该学什么?
- 50国内外最优秀的C/C++源代码网站分享
- 分享50个最新的免费PSD文件模版下载 (上)
- 分享_浅谈:国内软件公司为何无法做大做强?
- Google前女软件工程师分享工作经历
- code Review实践分享 邮件
- DedeCMS图集外链图片插件 DedeCMS8分享下载
- 我在这里3在引发众1.8万的经验分享
- 分享到微信微博空间等第三方平台的JS代码