TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Basit Khan
NA
336
121.6k
TaskSheduler in .Net
Nov 17 2016 6:01 AM
Hi,
I download the dll file from http://taskscheduler.codeplex.com/.
i also add reference Imports Microsoft.Win32.TaskScheduler
Below code is working after one minute and then open notepad file.
What i want is Weekly basis Monday, tuesday and wed at around 11:00 AM this sheduler fire.
How to do this.
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)
' Add a trigger that will fire every week on Friday
'td.Triggers.Add(New DailyTrigger)
' Add an action that will launch Notepad whenever the trigger fires
td.Actions.Add(New ExecAction("notepad.exe"))
' Register the task in the root folder
Const taskName As String = "Test"
ts.RootFolder.RegisterTaskDefinition(taskName, td)
End Using
End Sub
Reply
Answers (
1
)
timer use in traffic signal. in c#
Crystal report not fill