Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm asking how to autoplay embed audio in a Specific time daily ? , i want it be fixed in the program not set by the user .
thanks ,
Posted

1 solution

You can try to use this snippet. Also in your main method use myTimer.Start() method to start the timer. After every execution you can reset the timer as well if required.

C#
System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Elapsed += new ElapsedEventHandler(OnTimer);
myTimer.Interval = 1000; //Means 1 second
myTimer.Enabled = true;

public void OnTimer(object source, ElapsedEventArgs e )
{
    //Your code here
}


Rate it if it solves your problem.
 
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