access to the registry key is denied When i want update the value

后端 未结 2 1148
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 17:12

i want edit Registry key called \"usbstor\" value and this my code in update method

  try
        {
            string path = baseRegistryKey + \"\\\\\" + Su         


        
2条回答
  •  执笔经年
    2020-12-16 18:04

    An alternative solution is to change the permissions on the registry key. Open the key using Regedit, right click and select 'Permissions'. Either add the profile that your application runs under (ie a service account) or select an existing group (ie Users) and grant them full access. This way you're not having to grant elevated privileges which is always a security concern.

提交回复
热议问题