473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

scheduler

Is there any information out there on how to build a good schedule
application that i can tell it at 1pm do this or at midnight do that?
thanks!
Nov 23 '05 #1
5 2242

"Brian Henry" <no****@nospam.com> wrote in message
news:eC**************@TK2MSFTNGP09.phx.gbl...
Is there any information out there on how to build a good schedule
application that i can tell it at 1pm do this or at midnight do that?
thanks!


Just write a .NET console app and then use the scheduler built into windows
to "schedule" it. :)

Control Panel->Scheduled Tasks

Greg
Nov 23 '05 #2
cant do that, this needs to be a windows service that will be doing
different tasks in the application dependent on a custom schedule users set
up on their client systems... kind of like scheduled reporting and such
Nov 23 '05 #3
In article <e#**************@TK2MSFTNGP14.phx.gbl>, Brian Henry wrote:
cant do that, this needs to be a windows service that will be doing
different tasks in the application dependent on a custom schedule users set
up on their client systems... kind of like scheduled reporting and such


You can still use the task scheduler... In the windows service, you
could override the ServiceBase.OnCustomCommand method. This allows your
service to receive a custom command with a numeric value in the range of
128 to 256. So, you could associate a numeric value with each of the
tasks (it could be a TaskType enum :).

Then, you have your windows program that is the interface that the user
sets up the schedule. The schedule is a task in the task scheduler.
What the task run is a simple little windows program with no gui that
takes the task number on the command line. All the program does is
simply call your services OnCustomCommand method:

Dim myService As ServiceController = New ServiceController ("MyServiceName")
If myService.Status = ServiceControllerStatus.Running Then
myService.ExecuteCommand (Convert.ToInt32 (args(0))

End IF

You service would might do something like:

Protected Override Sub OnCustomCommand (ByVal command As Integer)
' You might use the ThreadPool to que a job or you could spawn
' a thread if you like.
Select Case command
Case 128
' code to stick the associated command into a thread pool?
Case 129
' code to stick the associated command into a thread pool?
End Select
End Sub

Now, sticking the actual task in the task scheduler is the hardest part
- fortunately, there are several .NET libraries to accomplish this :)
Here is one I wrote:

http://mtogden.com/~tom/files/SchedulingAgent.NET.zip

It is the C# source code. Anyway, that is one idea :)

--
Tom Shelton
Nov 23 '05 #4
I don't want to use a task scheduler from windows at all, because it could
change in the future how it works, actually i know for a fact windows vista
is changing how it works drastically.
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
In article <e#**************@TK2MSFTNGP14.phx.gbl>, Brian Henry wrote:
cant do that, this needs to be a windows service that will be doing
different tasks in the application dependent on a custom schedule users
set
up on their client systems... kind of like scheduled reporting and such


You can still use the task scheduler... In the windows service, you
could override the ServiceBase.OnCustomCommand method. This allows your
service to receive a custom command with a numeric value in the range of
128 to 256. So, you could associate a numeric value with each of the
tasks (it could be a TaskType enum :).

Then, you have your windows program that is the interface that the user
sets up the schedule. The schedule is a task in the task scheduler.
What the task run is a simple little windows program with no gui that
takes the task number on the command line. All the program does is
simply call your services OnCustomCommand method:

Dim myService As ServiceController = New ServiceController
("MyServiceName")
If myService.Status = ServiceControllerStatus.Running Then
myService.ExecuteCommand (Convert.ToInt32 (args(0))

End IF

You service would might do something like:

Protected Override Sub OnCustomCommand (ByVal command As Integer)
' You might use the ThreadPool to que a job or you could spawn
' a thread if you like.
Select Case command
Case 128
' code to stick the associated command into a thread pool?
Case 129
' code to stick the associated command into a thread pool?
End Select
End Sub

Now, sticking the actual task in the task scheduler is the hardest part
- fortunately, there are several .NET libraries to accomplish this :)
Here is one I wrote:

http://mtogden.com/~tom/files/SchedulingAgent.NET.zip

It is the C# source code. Anyway, that is one idea :)

--
Tom Shelton

Nov 23 '05 #5
In article <#Y**************@TK2MSFTNGP15.phx.gbl>, Brian Henry wrote:
I don't want to use a task scheduler from windows at all, because it could
change in the future how it works, actually i know for a fact windows vista
is changing how it works drastically.


Well... If you don't want to use the scheduler, then another choice
is to use a timer. I would look at system.threading.timer or
system.timers.timer. Especially if your going to use these in a windows
service environment.

--
Tom Shelton
Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: keepyourstupidspam | last post by:
Anyone know of a reliable design for a Windows C++ Task Scheduler Class. The scheduler will expose a member function that will add schedules, its parameters will be an interval to run the tasks...
1
by: Mike Thomas | last post by:
I want to start this thread again - on my first attempt I was a little ambiguous and was not able to get the answer I need. I am trying to start Access 2000 on Windows NT 2000 Server by using the...
1
by: Neil Ginsberg | last post by:
I am having trouble using Windows Scheduler with an A2K database that has a password. The password is a db password, not a user-level security password. I have a routine I am looking for Scheduler...
4
by: LongBow | last post by:
Hello all, I have been working on my first embedded project which has been exciting and stressfull at the same time. My task now is to develop a good scheduler for transmitting ARINC labels....
7
by: Shane Story | last post by:
Have an app and would like to allow easy addition of MYAPP.EXE /F /P (for example) my prog with command line args, as a job to be run. Would like to make it easier on the user to run the app. ...
8
by: VMI | last post by:
I'm searching for a way to build a scheduler that will store its data in sql server. I've searched google but it mostly displays sites that sell scheduler controls. Anyone know of any sites that...
3
by: mayur_hirpara | last post by:
Hi, I am writing a VB.NET application. It is a Windows application at the moment. The application contains a button. the click event of button perform a long running task. It needs to be started...
2
by: yamca | last post by:
I want to write a task scheduler. But i cant make the logic between the scheduler and tasks. For example a have an external process which can add and delete tasks from scheduler. Every task has...
4
by: Sid Price | last post by:
Is there a .NET (2003) class available somewhere that might provide a comprehensive task scheduler with a better granularity than the one minute of the built-in scheduler on XP? Even down to 15...
1
by: =?Utf-8?B?YXVzdGlyb2I=?= | last post by:
Hi, While I realise that this may not be a very nice solution architecturally, I kick off a Scheduler in an ASP.NET 2.0 webservice in Application_Start() which is supposed to call a stored proc...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.