1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
Public Class ServiceRapport
Public Sub New()
MyBase.New()
InitializeComponent()
If Not System.Diagnostics.EventLog.SourceExists("MySource") Then
System.Diagnostics.EventLog.CreateEventSource("MySource", "MyLog")
End If
RapportLog.Source = "MySource"
RapportLog.Log = "MyLog"
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
Timer1.Enabled = True
RapportLog.WriteEntry("Démarrage du Service " & CStr(TimeOfDay), EventLogEntryType.Information)
End Sub
Protected Overrides Sub OnStop()
Timer1.Enabled = False
RapportLog.WriteEntry("Arret du Service " & CStr(TimeOfDay), EventLogEntryType.Information)
End Sub
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Elapsed
Dim perso As New Personnage
RapportLog.WriteEntry(perso.getNom(), EventLogEntryType.Information)
End Sub
End Class |
Partager