English 中文(简体)
多面阅读
原标题:multi threading on asp.net

我没有将多面读作成像。 我有一个网络应用程序,把一个大的温带上倍。 我愿接手这一节奏文件,并在文件上载后做一些其他事情。 如果没有用户在网站上查阅,我能否在另一个读物上做这项工作? 感谢任何帮助或建议。

1.User post large file 2.uploading temp to server 3.After upload completes. I would like to run another thread/worker that can run without any user iteration but is trigger by the user.

void uploading(){
//Uploading file To server
}
void Submitclick(){
Start a Thread 
Thread thread = new Thread(DoThreadWork);// does the user still need to be logged in?
Send to another page
}
void DoThreadWork(){Do this in background}
最佳回答

这无疑是可能的,我先在伙伴关系中使用了相当重要的背景。 NET用于做一些微弱的 st。 如果你完全控制服务器,那么在单独的应用程序或窗户服务中管理背景代码可能更合适。

它使大家的关切更加分离,使你们的国际数据系统能够只处理对网络要求的反应,而没有这样做。

还有一个警告,如果你在伙伴关系中有一个背景。 NET 2.0,而且有一个未经处理的例外情形,缺省是重新建立申请库。

More information here: http://blogs.msdn.com/b/tess/archive/2006/04/27/584927.aspx

iii

清单是,避免在背景线上做一些事情是不可能的。 我在若干局势中对此进行了袭击:

  • I ve worked in a company with an unreasonable attitude to software where we were not allowed to deploy a separate app to handle the background processing. I argued for a windows service, but was overruled and told to implement it in a background thread. Obviously I moved on from that company to a healthier environment, but that is the reality is this you have to deal with unreasonable situations sometimes.
  • if you re in a hosted environment you don t always have the option to offload onto a seperate process.

The question was if it is possible. I m answering that question.

问题回答

如果你想要将文件上载从网站用户互动中分离出来,那么你就可以提供窗口服务,从而不时地检查,如果档案可以上载并上载。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签