Dotnet scheduler like the Windows "Schedued Tasks" scheduler?

C

Codemonkey

Hi,

I am writing an App in .Net that involves some scheduling of tasks. I was
wondering if anybody has come accross any components or examples of how to
implement a schedule manager like the one in the Task Scheduler for Windows?

Basically I'm after something that'll allow me to specify a "recurring" or
"once off" schedule with advanced options like "the first monday in the
month" etc.

I could go ahead and write my own, but a wee voice keeps whispering the
words "Code Reuse" and "go on, be lazy" ;)

If I can't find anything that is of any use, I'll go ahead and write my own.
If anybody else is interested in a reusable component like this, let me know
your ideas and I'll take them into account when writing it. Being close to
Christmas and all that, I might even post the finished code ;)

Cheers for the help.

Trev.
 
A

Ayende Rahien

Codemonkey said:
Hi,

I am writing an App in .Net that involves some scheduling of tasks. I was
wondering if anybody has come accross any components or examples of how to
implement a schedule manager like the one in the Task Scheduler for Windows?

Basically I'm after something that'll allow me to specify a "recurring" or
"once off" schedule with advanced options like "the first monday in the
month" etc.

I could go ahead and write my own, but a wee voice keeps whispering the
words "Code Reuse" and "go on, be lazy" ;)

If I can't find anything that is of any use, I'll go ahead and write my own.
If anybody else is interested in a reusable component like this, let me know
your ideas and I'll take them into account when writing it. Being close to
Christmas and all that, I might even post the finished code ;)

Just use the windows one:
http://www.msjogren.net/dotnet/eng/samples/misc.asp
http://www.codeproject.com/csharp/taskschedulerlibrary.asp
http://www.codeproject.com/csharp/TSNewLib.asp
 
C

Codemonkey

Thanks. I seen these and forgot to mention them in my first post. Although
it's pretty much exactly what I need, I'd like a self contained one (as
explained in my other post)

Cheers anyway.

Trev.
 
T

Tian Min Huang

Hello Trev,

Thanks for your post. As I understand, you want to create a Scheduled Tasks
of your own. Please correct me if there is any misunderstanding. I now
share the following information with you:

Windows has a services named "Task Scheduler" which enables a user to
configure and schedule automated tasks. That is, it is this service that is
responsible for running programs at their scheduled times. I suggest that
you can also create a Windows Service which runs at background, monitors
the time, and launches the appropriate tasks. Please refer to the following
MSDN article for detailed information on .NET Windows Service Application:

Introduction to Windows Service Applications
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbconintroductiontontserviceapplications.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Codemonkey

Thanks for the help. I don't think I'll need to go as far as writing a
service to host the Task Scheduling abilities that I need at the moment.

Here's my idea so far:

1) .net Class library that mimics the Windows Task Scheduler (with Task and
Trigger objects etc.)

2) This library can be hosted by any application (Windows Forms or Windows
Service etc.)

3) The settings for each task and schedule are saved along with the other
settings for the application that hosts it (removes the need for ".job"
files to be created)

4) Tasks are only triggered if the host application is running. This is fine
as most tasks will be related internally to the application itself.

Let me know if anybody has anything to add to this,

Thanks again for your help,


Trev.
 
J

jmag

hi, ive written a class in vb.net that does exactly what your looking for..
it contains almost all of the functionality that can be found in the Outlook
Appointment Recurrence option :)
 
C

Codemonkey

hi, ive written a class in vb.net that does exactly what your
looking for

Nice one.

For the sake of saving me (and a few others who might need this
functionality in the future), would you consider sharing the code?

When I do get around to writing my own (if I have to), I was planning to
post an article on CodeProject (http://www.codeproject.com).

If you don't fancy sharing the code, never worry. I'm sure I'll be bored of
watching Christmas films over the holidays that I might get around to doing
it (Cough.... Nerd.... Cough...) ;)

Trev.
 
T

Tian Min Huang

Hi,

Thanks for your information. Basically, I suggest that you can create a
Timer for each scheduled task, when a specified number of time units elapse
you can call Process.Start to start the task.

Process.Start Method (String)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticsprocessclassstarttopic3.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Codemonkey

Thanks for the info. It'll come in handy when it comes to writing the
application.

Trev.
 
J

jmag

Hi mate, i would but i cant supply the code due to contractual terms layed
out in my contract ( i wrote it at work ya see)... the way it goes I guess..

it was too difficult.. if wanna ask any questions tho, then feel free to
ask..

j
 
C

Codemonkey

Cheers J, I thought you were just teasing us ;)

I'll let you know how I get on (If I do go ahead and write it)

Trev.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top