Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I work with winForm c#
and i want to know how can i call or execute a function at specific time?
Posted
Comments
Sergey Alexandrovich Kryukov 22-Oct-13 15:46pm    
Are you sure you need to call a function, not to launch an application?
—SA
Member 10220821 22-Oct-13 15:50pm    
my form c# is for sending sms from laptop to mobile.
i want to find a way to call function (send) at specific time.
that is what i need
Sergey Alexandrovich Kryukov 22-Oct-13 15:59pm    
Got it, thank you. Please see Solution 1 and Solution 2.
—SA

You might use a timer for the purpose. However I recommend using the Windows Task Scheduler instead.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Oct-13 15:57pm    
Agree, a 5. I added some detail in my answer, please see.
—SA
In addition to Solution 1, please see my past answer, for more detail:
Problem a Window Services[^]

—SA
 
Share this answer
 
Hi, In your window form add the control timer, then giving double click on it, insert the function that you want to run, on the property of the timer must indicate the execution time in milliseconds

  eg
  private void timer1_Tick (object sender, EventArgs e)
  {
             timer1.Start ();
             / / Function name ();
             timer1.Stop ();
  }

Vanzetty Durant
 
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