-
Notifications
You must be signed in to change notification settings - Fork 0
net90_EventLogHelper.Interfaces_IRegistryReader_HasRegistryAccess
dparvin edited this page Sep 10, 2025
·
1 revision
Verifies whether the current user has sufficient permissions to access a registry key.
public bool HasRegistryAccess(RegistryHive hive, string machineName, string registryPath,
bool writeAccess)| parameter | description |
|---|---|
| hive | The root RegistryHive (e.g., RegistryHive.LocalMachine). |
| machineName | The target machine name. Use "." for the local machine. |
| registryPath | The registry key path relative to the specified hive. |
| writeAccess | If True, checks whether write access is allowed; if False, checks for read access. |
True if the user has the requested access; otherwise, False.
This method is critical when creating event sources, since writing registry entries in SYSTEM\CurrentControlSet\Services\EventLog requires administrative privileges.
- interface IRegistryReader
- namespace EventLogHelper.Interfaces
- assembly EventLogHelper