How to run the program at particular time? It should run
everyday at 3:00 PM. After executing the program should
sleep until next day at 3:00 PM. Please explain with code?
Answers were Sorted based on User's Feedback
Answer / tarun singla
To run any application at a particular time, we can add
that application to the Scheduled Tasks and configure it to
start at a particular time and repeat at a particular
interval.
| Is This Answer Correct ? | 10 Yes | 4 No |
Answer / ram
U CAN CONFIGURE TO THE SCHEDULAR IN THE SYSTEM OR U CAN
WRITE SERVICE AT THE BACK END
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / sudhir kunnure
Write an application and create exe of that application.
then open sheduled tasks in control panel. add this exe in
scheduled task and set time as you required. It automatic
get executed ,on given time.
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / renu
Here is the code that you expected.
public static void Main()
{
Timer timer = new Timer();
timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
timer.Interval = Convert.ToDouble
(ConfigurationManager.AppSettings["TimerInterval"]) * 1000;
timer.Enabled = true;
}
private void OnElapsedTime(object source, ElapsedEventArgs
e)
{
timer.Enabled = false;
//Call your business logic here
timer.Enabled = true;
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / susan
He said after the *PROGRAM* should sleep until a certain
time.
That's not the same as "just keep re-running and exiting
the program over and over again, using the Window's
scheduler".
He wants *CODE* that will do that.
| Is This Answer Correct ? | 2 Yes | 0 No |
What is string empty?
Is it possible to have different access modifiers on the get/set methods of a property in c#?
What?s a delegate?
what is the need of using interface in program ex:if we have a program like this interface1() { void method1(); void method(); } class a1 : interface1 { a1 b = new b(); b.method1(); b.method2(); } so without using interface also we can achieve this then wat is the need to use the interface? plz give me the answer
Can private virtual methods be overridden in c#.net?
Why would you use untrusted verification?
What are winforms in c#?
Which one is trusted and which one is untrusted?
What is the base class from which all value types are derived?
If I have code like try { return; } catch { return; } finally { return; } from which block will the value will be returned. and try has been executed without any error.
Which constructor is called first in c#?
Which namespace is required to implement trace ?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)