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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use delegates with events?

974


What is class method c#?

881


3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close

1796


Explanation on Generic?

954


What is cosole application?

1061


What do you mean by “finalize” and “finally” methods in c#?

896


What is serialization in dot net?

935


What is dto c#?

883


what are the Disadvantages of vb

1021


What does void mean unity?

923


Explain how can I get around scope problems in a try/catch?

896


Explain the difference between the system.array.copyto() and system.array.clone()?

908


How can i Spawn a Thread

891


What is int16?

899


Define an escape sequence, name few strings in escape sequence?

922