Hi guys, I'm pretty new to coding and am trying to write a small app which shows a list of all the scheduled tasks on the local machine, along with the description and scheduled execution date/time. I'd like to have this info in a datagridview.
I've been trying to use the below code to get a list of the tasks, but I'm not sure what to do in the "do something here". What do I need to do now to get that info out?
I should mention I'm using VB.
I've been trying to use the below code to get a list of the tasks, but I'm not sure what to do in the "do something here". What do I need to do now to get that info out?
I should mention I'm using VB.
Private Sub EnumAllTasks()
Using ts As New TaskService()
EnumFolderTasks(ts.RootFolder)
End Using
End Sub
Private Sub EnumFolderTasks(ByVal fld As TaskFolder)
For Each task As Task In fld.Tasks
ActOnTask(task)
Next task
For Each sfld As TaskFolder In fld.SubFolders
EnumFolderTasks(sfld)
Next sfld
End Sub
Private Sub ActOnTask(ByVal t As Task)
'do something here
End Sub