I want to read logs from event viewer folders which are in "Applications and Services Logs" but I cannot found those folders in C#.
Below is my code:
if (EventLog.Exists("MyApp-Folder1-Folder2/General"))
{
EventLog log = new EventLog("MyApp-Folder1-Folder2/General");
log.EntryWritten += new EntryWrittenEventHandler(OnEntryWritten);
log.EnableRaisingEvents = true;
}
If the log is found, I want to set watcher on that folder. The above path exists inside "Applications and Services Logs" but still EventLog.Exists() returns false.
How can I read such logs in C#?
EventLog.SourceExists- Jehof