请教!c#程序运行无反应
写了个到点自动关机的程序,运行起来没有反应,请大家帮忙检查下,自己感觉代码没问题,搞不懂了!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{ Timer time1=new Timer();
time1.Interval = 60000;
time1.Elapsed += new ElapsedEventHandler(time1_Elapsed);
time1.Enabled = true;
time1.AutoReset = true;
time1.Start();
}
static void time1_Elapsed(object sender, ElapsedEventArgs e)
{
DateTime current = new DateTime();
current = DateTime.Now;
if (current.Hour>=19|current.Hour<6)
{
Process.Start("shutdown", "-s -f -t 60");
}
}
}
}
请大家指教!