protected override void OnStart(string[] args) { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "OPC_Service"; eventLog.WriteEntry("Iniciado serviço", EventLogEntryType.Information, 101, 1); } //run the opc client opcClient.Run(); WriteToFile("Service is started at " + DateTime.Now); //timer.Elapsed += new ElapsedEventHandler(OnElapsedTime); //timer.Interval = 15000; //number in milisecinds //timer.Enabled = true; }