how to continuously run a c# console application in background

前端 未结 4 440
醉梦人生
醉梦人生 2021-01-19 06:58

I would like to know how to run a c# program in background every five minute increments. The code below is not what I would like to run as a background process but would lik

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-19 07:26

    Why not just use Windows Task Scheduler?

    Set it to run your app at the desired interval. It's perfect for this sort of job and you don't have to mess about with forcing threads to sleep which can create more problems that it solves.

提交回复
热议问题