Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all,
I'm developing a windows service alarm clock using c# language at visual studio 2010.My alarm clock is designed for alarming any time,any date,any year.But if I set alarm with a date of after 5 days in this year at 3:30am it doesn't work because the system can not save the alarm time within date & year & alarm file.How can I solve it?Please help me.
Posted

1 solution

Of course you can do it. But, instead of developing your own service, why not using one which is already available and designed for such purposes?

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
 
Comments
zakariashuvo 28-Dec-14 8:50am    
Thank you very much
Sergey Alexandrovich Kryukov 28-Dec-14 11:05am    
You are welcome. Will you accept the answer formally (green "Accept" button)? In all cases, your follow-up questions will be welcome.
—SA

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