protected override void OnStart(string[] args) { if (_powerOff == null) { _powerOff = new PowerOff(); } if (_powerOff.Running == false) { _powerOff.Start(); } }
static void Main(string[] args) { Console.WriteLine(PowerOffConfiguration.LogFileLocation); var service = new PowerOff(); service.Start(); Console.WriteLine(); Console.WriteLine("===================="); Console.WriteLine("Done."); Console.ReadLine(); }