A
Ahmad Jalil Qarshi
Hi!
I am developing an application in C# as a windows NT Service.
This application needs to check for eventlog using
EventLog.Exists("System")
But unfortunately it generates exception "Requested registry access is not
allowed."
After that I tried to verify it using registry
RegistryKey eventLogKey
=Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\Eventlog\\System");
But it also generate exception.
I check on net but found no solution.
Furthermore if I try to read any registry value under HKEY_CURRENT_USER.
using the above mentioned method it return null.
Any solution to solve this problem will be highly appriciated.
Regards,
Ahmad Jalil Qarshi
I am developing an application in C# as a windows NT Service.
This application needs to check for eventlog using
EventLog.Exists("System")
But unfortunately it generates exception "Requested registry access is not
allowed."
After that I tried to verify it using registry
RegistryKey eventLogKey
=Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\Eventlog\\System");
But it also generate exception.
I check on net but found no solution.
Furthermore if I try to read any registry value under HKEY_CURRENT_USER.
using the above mentioned method it return null.
Any solution to solve this problem will be highly appriciated.
Regards,
Ahmad Jalil Qarshi