Re: Requested registry access is not allowed.
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 9 Jun 2006 11:51:58 +0200
"Steve Teeples" <SteveT@xxxxxxxxxxxxxxxxx> wrote in message
news:FB24C9A3-0855-4943-82E6-0E01DA7147DD@xxxxxxxxxxxxxxxx
|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.
|
| --
| -----------
| Thanks,
| Steve
Because of User Account Control (UAC) in Vista, the application requires
elevated permissions to get at the Security data. Please read this:
http://msdn.microsoft.com/windowsvista/reference/security/default.aspx?pull=/library/en-us/dnlong/html/accprotvista.asp,
especially the part that talks about an assembly manifest.
Note also that you should post Vista related questions to the Microsoft
forums at http://forums.microsoft.com
Willy.
.
- Prev by Date: How to detect if the mouse is inactive?
- Next by Date: Re: why?
- Previous by thread: Re: Requested registry access is not allowed.
- Next by thread: Re: Requested registry access is not allowed.
- Index(es):
Relevant Pages
|