EventLog elog = new EventLog("Application",".");foreach (EventLogEntries entry in elog.Enttries)............
EventLog elog = new EventLog("Application",".");foreach (EventLogEntries entry in elog.Enttries){if(entry.EntryType== EventLogEntryType.Error && entry.EntryType== EventLogEntryType.Warning{....}}