Tôi muốn gọi một số phương thức sau mỗi 5 phút. Tôi có thể làm cái này như thế nào?Gọi phương thức mỗi x phút
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("*** calling MyMethod *** ");
Console.ReadLine();
}
private MyMethod()
{
Console.WriteLine("*** Method is executed at {0} ***", DateTime.Now);
Console.ReadLine();
}
}
'System.Threading.Time r' –
hoặc System.Timers.Timer - http://www.dotnetperls.com/timer – sinanakyazici