Beispiel #1
0
        protected void GetAllRelevantRequests(object sender, System.Timers.ElapsedEventArgs args)
        {
            eventLog.WriteEntry("MonitorService:In GetAllRelevantRequests.");
            List <RequestDto> requestDtos = RequestBL.GetAllRelevantRequests(eventLog);

            foreach (var request in requestDtos)
            {
                byte[] newPlay  = Play(request.recording_stream);
                bool   isChange = Compere(newPlay, request.file_stream);
                if (isChange)
                {
                    SendMail(request.userMail);
                }
            }
            eventLog.WriteEntry("Monitoring the System", EventLogEntryType.Information, eventId++);
            using (StreamWriter outputFile = new StreamWriter(Path.Combine("M:\\", eventId + "test.txt"), true))
            {
                outputFile.WriteLine(eventId);
            }
        }
Beispiel #2
0
        protected void Monitoring(object sender)
        {
            eventLog.WriteEntry("MonitorService:In GetAllRelevantRequests.");
            // get all relevant requests
            List <RequestDto> requestDtos = RequestBL.GetAllRelevantRequests(eventLog);

            // for each request
            foreach (var request in requestDtos)
            {
                try
                {
                    request.eventLog = eventLog;
                    // create thread and initialization the function
                    Thread thread = new Thread(RequestBL.ThreadFunction);
                    // run the function
                    thread.Start(request);
                }
                catch (Exception ex)
                {
                    eventLog.WriteEntry(ex.ToString());
                }
            }
            eventLog.WriteEntry("Monitoring the System", EventLogEntryType.Information, eventId++);
        }