如何在asp.net中执行长文件生成运行任务 [英] how to Exeucte the long file generatin running task in asp.net

查看:65
本文介绍了如何在asp.net中执行长文件生成运行任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中执行长时间运行的任务

how to execute a long running task in asp.net

推荐答案

^ ]

并查看CancelAsync()方法,因为这将允许您取消后台工作程序.那里有一个很好的例子.



我已经读了一些书,并且由于该论坛线程指出您可以使用后台工作程序线程 BUT ,因此建议不要这样做.

如何在asp.net中进行后台线程 [
MSDN: backgroundworker [^]

and have a look at the the CancelAsync() method as this will allow you to cancel the background worker. It has a good example in there.



I have done some more reading and as this forum thread states you can use a background worker thread BUT it is advisable not too.

How to do a background thread in asp.net[^]


一种方法是使用反向ajax/彗星为服务器完成,然后通知客户端.

http://en.wikipedia.org/wiki/Comet_(programming) [ http://ruwandotnet.wordpress.com/category/signalr/ [ http://sachabarbs.wordpress.com/2012/01/21 /signalr-best-thing-since-slice-bread/ [
One way would be to use reverse ajax / comet to provide a means for the server to complete and then notify the client.

http://en.wikipedia.org/wiki/Comet_(programming)[^]

Another method would be to use SignalR

http://ruwandotnet.wordpress.com/category/signalr/[^]
http://sachabarbs.wordpress.com/2012/01/21/signalr-best-thing-since-slice-bread/[^]

Which ever root you take in essence you create a polling / long running connection to the server and when the server processing is complete you then update the client.


这篇关于如何在asp.net中执行长文件生成运行任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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