I am able to read the data from the application event logs but when i try the security i get an error

Requested registry access is not allowed.
{"Cannot open log security on machine .. Windows has not provided an error code."}
{"A required privilege is not held by the client"}

Anyone know how to sort this?

I am using Vista

Try to run your application as administrator, right click on your executable then Run as Administrator, try and tell me what you get.

Hi mate,

I am a full administrator, i think its another one of these great security features added into vista.

I can read from the other event logs just not from the security one

Just! did you try it?? :)

i am just running the progrma from inside vs 2008, how do i create it as an exe?

Right click on VS icon, and run it as administrator.

ah right sorry i taught you wanted me to create an exe of the project then run it.

If i run vs2008 as administrator it read from the security logs.

But how do i get it to allow me to run them from my user?

Logical, non administrative staff can't read this information! right? so if your user is administrator he can do what we've done -> right click on your application and run it as administrator.

the problem is the program when finished will be running as a windows service so will require no user interaction. Its just going to mine data and pass it back to the database.

So i need to get it to allow me to access the security logs.

Look to deploy it as windows service, should be also installed as administrator! then it'll work without any interaction with the current user.

ah cool, i was going to deploy it as a windows service, i have a test service running so once i get that code perfected i will drop the code to read the event logs into it.

Great and also don't forget to mark it as solved!

no probs and thanks for the help again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.