static void Main(string[] args) { if (Environment.UserInteractive || Environment.OSVersion.Platform == PlatformID.Unix) { // start thread directly HtpService.Start(args); // and wait for finish before closing console HtpService.rst.WaitOne(); } else { // running as service HtpService.enabled = true; ServiceBase.Run(new Service()); } }
protected override void OnStop() { GlobObj.OutL("Hashtopus service was stopped."); HtpService.Stop(); }
protected override void OnStart(string[] args) { HtpService.Start(args); }