G
Guest
I have a piece of code (written is Visual Studio 2005) that is only reading
the Security EventLog. On Windows XP Professiona/Home this code works just
fine.
int numberOfEntries = myEventLog.Entries.Count;
if (numberOfEntries > 0) ...
However, when run under Windows Vista I get the error "Requested registry
access is not allowed." This error occurs when the first line of code is
executed.
I tried adding the command below before the count is retrieved but it didn't
work.
EventLogPermission elp = new
EventLogPermission(EventLogPermissionAccess.Administrator, ".");
Does anyone know how to get around this issue. This error only occurs with
the Security event log, not the "Application" or "System" event logs.
the Security EventLog. On Windows XP Professiona/Home this code works just
fine.
int numberOfEntries = myEventLog.Entries.Count;
if (numberOfEntries > 0) ...
However, when run under Windows Vista I get the error "Requested registry
access is not allowed." This error occurs when the first line of code is
executed.
I tried adding the command below before the count is retrieved but it didn't
work.
EventLogPermission elp = new
EventLogPermission(EventLogPermissionAccess.Administrator, ".");
Does anyone know how to get around this issue. This error only occurs with
the Security event log, not the "Application" or "System" event logs.