Cannot write to Registry Key, getting UnauthorizedAccessException

前端 未结 1 1504
小鲜肉
小鲜肉 2020-12-29 19:37

I have a windows service that attempt to write to a registry key in LOCAL_MACHINE

The key is created as part of a windows installer package the controls the windows

1条回答
  •  太阳男子
    2020-12-29 20:20

    RegistryKey.OpenSubKey(string) does not open the key for writing. Try using the OpenSubKey(string, bool) overload to specify that you want the key to be writable.

    0 讨论(0)
提交回复
热议问题