public static int Main(String[] args) { ManagerDeviceProvider managerDevice = new ManagerDeviceProvider(); managerDevice.StartService(); Console.ReadKey(); managerDevice.StopService(); return(0); }
/// <summary> /// Start Service /// </summary> /// <param name="args"></param> protected override void OnStart(string[] args) { try { device = new ManagerDeviceProvider(); device.StartService(); EventLog.WriteEntry("Shiol Service Started", EventLogEntryType.Information); } catch (Exception e) { EventLog.WriteEntry("Shiol Service Start ERR. " + e.Message, EventLogEntryType.Error); } try { serviceHost = new WebServerServiceProvider(); serviceHost.StartService(); EventLog.WriteEntry("Web Service Started", EventLogEntryType.Information); } catch (Exception e) { EventLog.WriteEntry("Web Service Start ERR. " + e.Message, EventLogEntryType.Error); } }