I have a problem, my application is running under admin rights (I have also manifest)
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
I'm making program to changing default icons. When I'm changing default icon for *.php file everything is ok. But if I want change default icon for *.mp3 file i get this error Requested registry access is not allowed. I dont know how can I get better privileges for workin开发者_如何转开发g with registry. I'm using only this -> RegistryKeyPermissionCheck.ReadWriteSubTree. And this gives me error:
FileExt = FileExt.OpenSubKey("UserChoice", RegistryKeyPermissionCheck.ReadWriteSubTree);
Thanks for response!
Have u already tried to start your Assembly as an administrator? To check this quickly just start the compiled application as an administrator.
To achieve this programmatically change the user context during the execution of your code look at this MSDN article: http://msdn.microsoft.com/en-us/library/w070t6ka.aspx
I added try catch -> try read/write catch read.
精彩评论