Setting up a scheduled task in .Net

前端 未结 2 556
走了就别回头了
走了就别回头了 2020-12-11 05:27

I\'ve read a few posts here on StackOverflow about task scheduling, but I\'m not sure that I get it right. I\'m coding (in VB.Net) a backup application, that I\'d like to ad

2条回答
  •  囚心锁ツ
    2020-12-11 06:19

    The best thing is to not write a scheduler, but use the built-in Windows scheduler to run your code.

    More info:

    http://support.microsoft.com/kb/308569

    Note: if you schedule a task to run under an account other than your own, the application may not have access to network drives or some other resources. In other words, there may be some security challenges to work through, particularly for something like a backup app.

    If this is just a personal app for backup, my recommendation would be to use XCOPY from a batch file rather than re-inventing the wheel.

提交回复
热议问题