static void Main(string[] args) { Timer0.InitializeLifetimeService(); Console.Title = "AutoUpdateScheduleTask"; // hide the console window setConsoleWindowVisibility(true, "AutoUpdateScheduleTask"); Console.WriteLine("Start checking..."); AutoScheule AutoSchedule = new AutoScheule(database); AutoSchedule.Update(); //Environment.GetFolderPath(Environment.SpecialFolder.Desktop) //var files = Directory.EnumerateFiles(@"\\svproxy\Department\CP\Planning Team\生管進度 - Production Schedule - Tiến độ của sinh quản\2020\202003"); //foreach (var item in files) //{ // Console.WriteLine(item); //} Console.WriteLine("Stop checking..."); Console.ReadLine(); }
private static void TimerCallBack(object state) { Tick++; Console.WriteLine($"Tick value: {Tick}"); if (Tick == 60 * 15) { Console.WriteLine("Start checking..."); Tick = 0; AutoScheule AutoSchedule = new AutoScheule(database); //AutoSchedule.Update(); Console.WriteLine("Stop checking..."); } }