Hi everyone,
I am trying to read off the "System" Event Log of a remote system.
I am getting the following error"Cannot open log System on machine 10.50.212.129. Windows has not provided an error code"
when i try to access the Application log, my application encounters the same error"Cannot open log Application on machine 10.50.212.129. Windows has not provided an error code"
The same code works fine for the Event Logs in my local system. The problem occurs when i am trying to access the logs of some remote system. After some initial digging on the internet i came to the conclusion that some permissions might be needed by the caller. i can see some C#.Net provided classes relating to permissions, but i cant find a gud MSDN link with an example to guide me.
Can someone please help me out...
i've used the code below.
EventLog eventLog = new EventLog("System","10.50.212.129");
foreach (EventLogEntry logEntry in eventLog.Entries)
{
if (logEntry.Source.Equals("smtpsvc") && logEntry.TimeGenerated > eventDate)
{
Console.WriteLine("Found One");
}
}
I get the error at the foreach statement.
Thanks in advance
-deathdarts