|
-
January 21st, 2010, 08:16 PM
#1
Can't access event log for tasks
// I am trying to access the log file at "Microsoft-Windows-TaskScheduler/Operational" but get an exception
string logName = "Microsoft-Windows-TaskScheduler/Operational";
EventLog log1 = new EventLog(logName, "myMachine");
foreach( EventLogEntry entry in log1.Entries )
{
}
// threw exception: System.InvalidOperationException: The event log 'Microsoft-Windows-TaskScheduler/Operational' on computer 'myMachine' does not exist..
Does anyone know what I need to do?
-
January 21st, 2010, 08:50 PM
#2
Re: Can't access event log for tasks
Perhaps you need to call "EventLog.CreateEventSource" if SourceExists returns false. Have you tried that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|