多线程和委托C#.使用异步方法帮助....... [英] multithreading and Delegates C#. using Asyncronous Methods help.......

查看:165
本文介绍了多线程和委托C#.使用异步方法帮助.......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题.
我已经了解了使用委托处理事件的概念(在某种程度上还不完整).但是这里还有别的东西.< b>
异步和同步方法.
1.两者有什么区别?简单的例子.</b>

< b> 2.我有一种方法需要30分钟才能完成,我不希望它挂断系统,我希望它进入后台,同时让我使用我的系统.当完成执行时,它会通知我它已经完成,并返回(如果有的话)它应该执行的数据.如何使用线程和委托实现C#? </b>

考虑我是编程的初学者,并向我解释.
非常感谢.
我会很感激的.
一个小例子,wud使我更容易

i have some ques.
i have understood the concept of handling the event using delegates (as some extent not whole). but there is some thing else here.<b>
Asynchronous and Synchronous Methods.
1.What is the difference between the two? simple example.</b>

<b>2. i have a method that takes 30 mint to complete, i dont want it to hangup the system, i want it to go to the background and let me use my system meanwhile. and when it finishes the execution, it informs me that it has completed and returns (if any) data that it supposed to do. How will i implement it C#, Using Threading and Delegates? </b>

Consider me the beginner in programming and explain it upto my level.
thank you so much.
i will appreciate it.
a little example wud make it easy for me

推荐答案

开始阅读http://msdn.microsoft.com/zh-CN/library/2e08f6yc(v=VS.100).aspx [轻松异步编程 [异步方法调用 [ http://www.dotnetscraps.com/dotnetscraps/post/Explaining-Delegates-in-C-Part-4-(Asynchronous-Callback-Way -1).aspx [
Start be reading through http://msdn.microsoft.com/en-us/library/2e08f6yc(v=VS.100).aspx[^].

Easy Asynchronous Programming[^] should be useful to you as well.
Asynchronous Method Invocation[^] and http://www.dotnetscraps.com/dotnetscraps/post/Explaining-Delegates-in-C-Part-4-(Asynchronous-Callback-Way-1).aspx[^] should give you ideas as well.


这篇关于多线程和委托C#.使用异步方法帮助.......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆