English 中文(简体)
背 景 不从事背景工作的工人
原标题:BackGroundWorker not executing on background

当我上下页时,我只能在背景工人工作完成后才能行走......它是否像名字所说的那样在背景上执行?

这部法律是:

    protected void Page_Load(object sender, EventArgs e)
    {
        BackgroundWorker _bgk = new BackgroundWorker();
        _bgk.DoWork += new DoWorkEventHandler(DoWork_BackGroundWork);
        _bgk.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkComplete_BackGroundWork);
        _bgk.RunWorkerAsync();
    }

    private void DoWork_BackGroundWork(object sender, DoWorkEventArgs e)
    {
        for (int i = 0; i < 99999; i++)
        {
            Trace.Write("STILL EXECUTING BACKGROUND WORKER");
        }
    }

    private void WorkComplete_BackGroundWork(object sender, RunWorkerCompletedEventArgs e)
    {
        Trace.Write("===================== BACKGROUND WORKER FINISHED ===================");
    }
最佳回答
问题回答

与协会合作。 NET很好。

最重要的是,除非你想起火力,否则发射背景线索就会让国际宇宙航行局在不了解你的情况下能够回收你的read子。 最好不要在伙伴关系中使用这种翻新。 NET环境(不说ever,但可以trick弄正确)

BackgroundWorker is only forWindows Forms, not for ASP. NET。

你们最好不要在协会中使用任何背景线索。 NET,除非您是多读的专家。

The BackgroundWorker is only designed to work using WindowsForms.

如果你想要模拟同样的不连续性,则使用<>Thread,但需在伙伴关系中使用read。 NET,确保你重新做的工作不会影响客户-服务器的通信。

并且,如果你必须使用翻新,则使用ThreadPool。 QueueWorkerItem(......)





相关问题
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!

热门标签