How can i check for RegistryKey permissions like ReadKey or FullControl in .NET?
问题 I want to check that I have permissions on a RegistryKey for example can I read values and write values. This blog enumerates permissions http://blogs.msdn.com/b/bclteam/archive/2006/01/06/509867.aspx How can I go from GetAccessControl() to knowing that I have for example FullControl? 回答1: I'm afraid there is no managed code for this. you could use a dllimport and invokeCheckAccess but i prefer just accessing the registry and handling the exception (if any) 来源: https://stackoverflow.com