a) Creating a webservice that calls a Thread?
b) Creatinga webservice with [SoapDocumentMethod(OneWay=true)]
c) Any better way? without using an external program?
Another way is queuing jobs. MSMQ or Service broker (SQL Server 2005).
1. Create a job class instance in .NET and assign a unique id to it (GUID,
auto incr in some table).
public class Job
{
string ID;
}
1.1 This class is a great place to put in the criterias required to perform
the long-running task.
2. Track the job. For example: with the Ticket (Job.ID), INSERT TABLE
tblJobs SET Completed = FALSE WHERE ID = @ID
3. When the job is done make sure the job executor updates the completion
bucket to say the job is done.
UPDATE tblJobs SET Completed = TRUE WHERE ID = @ID
4. Until then, give your response page the Job ID. It will refresh (great
place to add an AJAX enabled progress bar) and use that ticket to check
whether the job is done or not in the completion bucket:
With the Ticket (Job.ID), Query for SELECT TOP 1 WHERE Completed = TRUE AND
ID = @ID
http://www.beansoftware.com/ASP.NET-Tutorials/Long-Operations.aspx
http://www.velocityreviews.com/forums/t119804-long-process-in-aspnet.html
http://msdn.microsoft.com/zh-cn/magazine/cc163725(en-us).aspx
http://stackoverflow.com/questions/579861/handling-long-page-execution-times-in-asp-net
http://www.ajaxmatters.com/articles/asp/long_run_process_p1.aspx
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23091386.html
http://www.eggheadcafe.com/articles/20051223.asp
http://geekswithblogs.net/joycsharp/archive/2007/11/22/117039.aspx
http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/
http://www.codeproject.com/KB/aspnet/asynctransactionhandler.aspx
http://dotnetslackers.com/ASP_NET/re-17817_ASP_NET_Long_Running_Tasks_with_Page_Feedback.aspx
http://weblogs.asp.net/ssharrock/archive/2004/02/02/66321.aspx
http://msdn.microsoft.com/en-us/magazine/2009.01.longrunwf.aspx
http://codebetter.com/blogs/peter.van.ooijen/archive/2006/06/20/146582.aspx
http://forums.asp.net/t/1276827.aspx
http://www.velocityreviews.com/forums/t116366-running-long-process-from-aspnet.html
http://stackoverflow.com/questions/617105/asp-net-httphandlers-and-long-running-processes
http://www.marklio.com/marklio/PermaLink,guid,de1c560e-9f2f-43e3-830e-3e195fbebea5.aspx
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。