Imports System
Imports System.Diagnostics
Imports System.ServiceProcess
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlDataReader
Imports System.Windows.Forms
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim eventLogApp As New System.Diagnostics.EventLog("Application")
'crca evento window che contiene "engine 2010 (Italia" e porta data maggiore del "03/02/2022"
Dim EventLogEntry As System.Diagnostics.EventLogEntry
Dim eventCntr As Integer = 1
Dim kk As String
For Each EventLogEntry In eventLogApp.Entries
kk = InStr(EventLogEntry.Message.ToString, "engine 2010 (Italia")
If kk > 0 And EventLogEntry.TimeGenerated.Date > "03/02/2022" Then
MsgBox(EventLogEntry.Source.ToString)
End If
Next
Exit Sub
If EventLogEntry.TimeGenerated.Date > "03/02/2022" Then
MsgBox(EventLogEntry.InstanceId.ToString)
End If
End Sub