.NET中的Tasksheduler [英] Tasksheduler in .NET

查看:172
本文介绍了.NET中的Tasksheduler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hi,

I download the dll file from http://taskscheduler.codeplex.com/.
 
i also add reference Imports Microsoft.Win32.TaskScheduler





What i want is Weekly basis Monday, tuesday and wed at around 11:00 AM this sheduler fire.
 
How to do this. 




谢谢
Basit.

我尝试过的事情:

下面是可以正常工作的代码.




Thanks
Basit.

What I have tried:

Below is the code working fine.

Private Shared Sub Main()


    Using ts As New TaskService()
        ' Create a new task definition and assign properties
        Dim td As TaskDefinition = ts.NewTask()
        td.RegistrationInfo.Description = "Does something"
        td.Principal.LogonType = TaskLogonType.InteractiveToken

        ' Add a trigger that will fire the task at this time every other day
        Dim dt As DailyTrigger = DirectCast(td.Triggers.Add(New DailyTrigger(2)), DailyTrigger)

        dt.Repetition.Duration = TimeSpan.FromMinutes(1)
        dt.Repetition.Interval = TimeSpan.FromMinutes(1)


        Const taskName As String = "Test"
        ts.RootFolder.RegisterTaskDefinition(taskName, td)
    End Using

End Sub

推荐答案

好吧,我首先问的是从中获得信息的人,而不是一个随机的网站.
如果您回到Codeplex,您将看到一个讨论"选项卡,可让您与作者交谈,因为其他人已经做过...
Well, I''d start by asking the people you got it from, rather than a random website.
If you go back to codeplex, you will see a "discussions" tab which lets you talk to the authors, as a bunch of other people have already done...


这篇关于.NET中的Tasksheduler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆