Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How to run the program at particular time? It should run everyday at 3:00 PM. After executing the ..

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

How to run the program at particular time? It should run everyday at 3:00 PM. After executing the ..

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

How to run the program at particular time? It should run everyday at 3:00 PM. After executing the ..

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

How to run the program at particular time? It should run everyday at 3:00 PM. After executing the ..

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

How to run the program at particular time? It should run everyday at 3:00 PM. After executing the ..

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

Post New Answer

More C Sharp Interview Questions

Can properties be static in c#?

0 Answers  


What is escape sequence in c#?

0 Answers  


How can I develop an application that automatically updates itself from the web?

0 Answers  


Write a console application and implement the ternary operator to decide whether the age a user entered after being prompted is allowed to vote or not(given that only citizens between 18 and 120 years only inclusive can vote). Use exception handling for non-numerical input.

0 Answers  


Can a class be private in c#?

0 Answers  


Can dictionary have duplicate keys c#?

0 Answers  


What is inner class in c#?

0 Answers  


Why is it important to override gethashcode when equals method is overridden?

0 Answers  


what is garbage collection?

8 Answers   Protech,


Can structs in c# have destructors?

0 Answers  


What is Custom attribute? How to create? If I'm having custom attribute in an assembly, how to say that name in the code?

0 Answers  


What is the difference between TypeOf and GetType?

4 Answers   Syntel,


Categories