Click here to Skip to main content
15,943,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a windows form application
and is installed in more than two systems
in LAN or say in network.

When Any modification is done in the
Main Module. Updates are sent
to each system using a windows
service which run in background in every system.

When update reaches to particular system
a notifyIcon notifies the user that updates
are available ,and then updating starts.

Updation is scheduled as per the updateinterval time set in the app.config file which
is a xml file .There we can Set manually the interval after which the updation
should start.

Now I want here that
a user Interface so that
user can schedule the service as Daily ,Hourly,weekly and Now options by setting a specific time of the day and week.

As we all have seen in case of Java updates .There is a system tray Icon.On right clicking the Icon it shows the Updation/scheduling options.

I want the some how the same Functionality .Am thinking of Context menu ,but how should i set the Time Interval.

Any Examples or Idea.
Please assist.
Posted

1 solution

Of course, you can use the timer inside your service and calculate appropriate times to launch your scheduled actions. The timing should be calculated based on the current time (System.DateTimeNow). But alternatively you can use external service already available in Windows.

It is already bundled with Windows and enabled; you can use it on different levels. It is called Window Task Scheduler, see http://en.wikipedia.org/wiki/Windows_Task_Scheduler[^].

First, you can schedule events using command-line utilities AT.EXE or CSHTASKS.EXE (which is replacing AT.EXE), see:
http://en.wikipedia.org/wiki/At_%28Windows%29[^],
http://en.wikipedia.org/wiki/Schtasks[^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].

And you also can use Window Task Scheduler API, please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v=vs.85%29.aspx[^].

To see how can you use it with .NET, see this CodeProject article: A New Task Scheduler Class Library for .NET[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900