本文介绍了后台工作while循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创造是执行每30秒几道工序后台工作。但我想这个while循环来执行,只要程序启动。这里是我使用的:

What i'm trying to create is a background worker that executes a few processes every 30seconds. But I want this while loop to execute for as long as the program is launched. here is what I am using:

    private void watcherprocess1()
    {
        backgroundWorker1.RunWorkerAsync();

    }  
    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    {
        while(
        Thread.Sleep(30000);
        specficView2();
        makeFormlist2();
        populateListview2();
    }

我的主要问题是AI能想到的一个好while循环保持这种运行

My main issue is ai can think of a good while loop to keep this running

推荐答案

您寻找

while(true)

这篇关于后台工作while循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 21:20