cannot write to the registry key

前端 未结 4 2298
耶瑟儿~
耶瑟儿~ 2020-12-05 13:25

I am getting error cannot write to the registry key when i am trying to save my keys in the registry .

//Here is my code .

Note : I tried to run as an Admin

4条回答
  •  温柔的废话
    2020-12-05 13:42

    if (null == skms)            
    {             
       skms = Registry.LocalMachine.OpenSubKey("SOFTWARE",true);              
       RegistryKey key = skms.CreateSubKey(
              RegistryKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree);      
    }
    

    This is the answer for my question .

提交回复
热议问题